var c0=Object.defineProperty;var fp=r=>{throw TypeError(r)};var d0=(r,t,s)=>t in r?c0(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s;var Ie=(r,t,s)=>d0(r,typeof t!="symbol"?t+"":t,s),$u=(r,t,s)=>t.has(r)||fp("Cannot "+s);var R=(r,t,s)=>($u(r,t,"read from private field"),s?s.call(r):t.get(r)),pe=(r,t,s)=>t.has(r)?fp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),ee=(r,t,s,o)=>($u(r,t,"write to private field"),o?o.call(r,s):t.set(r,s),s),Pe=(r,t,s)=>($u(r,t,"access private method"),s);var xa=(r,t,s,o)=>({set _(a){ee(r,t,a,s)},get _(){return R(r,t,o)}});function f0(r,t){for(var s=0;so[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=s(a);fetch(a.href,u)}})();function Wc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Vu={exports:{}},jo={},Hu={exports:{}},Ce={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hp;function h0(){if(hp)return Ce;hp=1;var r=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.iterator;function k(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,b={};function x(N,z,ce){this.props=N,this.context=z,this.refs=b,this.updater=ce||L}x.prototype.isReactComponent={},x.prototype.setState=function(N,z){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,z,"setState")},x.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function S(){}S.prototype=x.prototype;function I(N,z,ce){this.props=N,this.context=z,this.refs=b,this.updater=ce||L}var P=I.prototype=new S;P.constructor=I,F(P,x.prototype),P.isPureReactComponent=!0;var A=Array.isArray,V=Object.prototype.hasOwnProperty,$={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function B(N,z,ce){var me,he={},X=null,ve=null;if(z!=null)for(me in z.ref!==void 0&&(ve=z.ref),z.key!==void 0&&(X=""+z.key),z)V.call(z,me)&&!G.hasOwnProperty(me)&&(he[me]=z[me]);var Re=arguments.length-2;if(Re===1)he.children=ce;else if(1>>1,z=K[N];if(0>>1;Na(he,U))Xa(ve,he)?(K[N]=ve,K[X]=U,N=X):(K[N]=he,K[me]=U,N=me);else if(Xa(ve,U))K[N]=ve,K[X]=U,N=X;else break e}}return ae}function a(K,ae){var U=K.sortIndex-ae.sortIndex;return U!==0?U:K.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var d=Date,h=d.now();r.unstable_now=function(){return d.now()-h}}var p=[],m=[],y=1,v=null,k=3,L=!1,F=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(K){for(var ae=s(m);ae!==null;){if(ae.callback===null)o(m);else if(ae.startTime<=K)o(m),ae.sortIndex=ae.expirationTime,t(p,ae);else break;ae=s(m)}}function A(K){if(b=!1,P(K),!F)if(s(p)!==null)F=!0,Se(V);else{var ae=s(m);ae!==null&&be(A,ae.startTime-K)}}function V(K,ae){F=!1,b&&(b=!1,S(B),B=-1),L=!0;var U=k;try{for(P(ae),v=s(p);v!==null&&(!(v.expirationTime>ae)||K&&!Ee());){var N=v.callback;if(typeof N=="function"){v.callback=null,k=v.priorityLevel;var z=N(v.expirationTime<=ae);ae=r.unstable_now(),typeof z=="function"?v.callback=z:v===s(p)&&o(p),P(ae)}else o(p);v=s(p)}if(v!==null)var ce=!0;else{var me=s(m);me!==null&&be(A,me.startTime-ae),ce=!1}return ce}finally{v=null,k=U,L=!1}}var $=!1,G=null,B=-1,ie=5,ue=-1;function Ee(){return!(r.unstable_now()-ueK||125N?(K.sortIndex=U,t(m,K),s(p)===null&&K===s(m)&&(b?(S(B),B=-1):b=!0,be(A,U-N))):(K.sortIndex=z,t(p,K),F||L||(F=!0,Se(V))),K},r.unstable_shouldYield=Ee,r.unstable_wrapCallback=function(K){var ae=k;return function(){var U=k;k=ae;try{return K.apply(this,arguments)}finally{k=U}}}})(Qu)),Qu}var vp;function y0(){return vp||(vp=1,qu.exports=g0()),qu.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wp;function v0(){if(wp)return Tt;wp=1;var r=qc(),t=y0();function s(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},v={};function k(e){return p.call(v,e)?!0:p.call(y,e)?!1:m.test(e)?v[e]=!0:(y[e]=!0,!1)}function L(e,n,i,l){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function F(e,n,i,l){if(n===null||typeof n>"u"||L(e,n,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function b(e,n,i,l,c,f,g){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=c,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=f,this.removeEmptyString=g}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){x[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];x[n]=new b(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){x[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){x[e]=new b(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){x[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){x[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){x[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){x[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){x[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function I(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(S,I);x[n]=new b(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(S,I);x[n]=new b(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(S,I);x[n]=new b(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){x[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),x.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){x[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,i,l){var c=x.hasOwnProperty(n)?x[n]:null;(c!==null?c.type!==0:l||!(2E||c[g]!==f[E]){var C=` `+c[g].replace(" at new "," at ");return e.displayName&&C.includes("")&&(C=C.replace("",e.displayName)),C}while(1<=g&&0<=E);break}}}finally{ce=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?z(e):""}function he(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=me(e.type,!1),e;case 11:return e=me(e.type.render,!1),e;case 1:return e=me(e.type,!0),e;default:return""}}function X(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case $:return"Portal";case ie:return"Profiler";case B:return"StrictMode";case xe:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ee:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case Te:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _e:return n=e.displayName||null,n!==null?n:X(e.type)||"Memo";case Se:n=e._payload,e=e._init;try{return X(e(n))}catch{}}return null}function ve(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X(n);case 8:return n===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function Re(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ye(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function tt(e){var n=ye(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,f=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(g){l=""+g,f.call(this,g)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(g){l=""+g},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ft(e){e._valueTracker||(e._valueTracker=tt(e))}function it(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return e&&(l=ye(e)?e.checked?"true":"false":e.value),e=l,e!==i?(n.setValue(e),!0):!1}function Xt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ut(e,n){var i=n.checked;return U({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function zt(e,n){var i=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;i=Re(n.value!=null?n.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function we(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function at(e,n){we(e,n);var i=Re(n.value),l=n.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Jt(e,n.type,i):n.hasOwnProperty("defaultValue")&&Jt(e,n.type,Re(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Yt(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Jt(e,n,i){(n!=="number"||Xt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Fn=Array.isArray;function Un(e,n,i,l){if(e=e.options,n){n={};for(var c=0;c"+n.valueOf().toString()+"",n=fi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Xs(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var Ys={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pv=["Webkit","ms","Moz","O"];Object.keys(Ys).forEach(function(e){pv.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Ys[n]=Ys[e]})});function Cd(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||Ys.hasOwnProperty(e)&&Ys[e]?(""+n).trim():n+"px"}function Rd(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var l=i.indexOf("--")===0,c=Cd(i,n[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,c):e[i]=c}}var mv=U({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function el(e,n){if(n){if(mv[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(s(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(s(61))}if(n.style!=null&&typeof n.style!="object")throw Error(s(62))}}function tl(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nl=null;function rl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sl=null,ss=null,os=null;function Td(e){if(e=xo(e)){if(typeof sl!="function")throw Error(s(280));var n=e.stateNode;n&&(n=ji(n),sl(e.stateNode,e.type,n))}}function Pd(e){ss?os?os.push(e):os=[e]:ss=e}function Nd(){if(ss){var e=ss,n=os;if(os=ss=null,Td(e),n)for(e=0;e>>=0,e===0?32:31-(Cv(e)/Rv|0)|0}var yi=64,vi=4194304;function to(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wi(e,n){var i=e.pendingLanes;if(i===0)return 0;var l=0,c=e.suspendedLanes,f=e.pingedLanes,g=i&268435455;if(g!==0){var E=g&~c;E!==0?l=to(E):(f&=g,f!==0&&(l=to(f)))}else g=i&~c,g!==0?l=to(g):f!==0&&(l=to(f));if(l===0)return 0;if(n!==0&&n!==l&&(n&c)===0&&(c=l&-l,f=n&-n,c>=f||c===16&&(f&4194240)!==0))return n;if((l&4)!==0&&(l|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0i;i++)n.push(e);return n}function no(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Zt(n),e[n]=i}function Ov(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0=co),sf=" ",of=!1;function af(e,n){switch(e){case"keyup":return ow.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ls=!1;function aw(e,n){switch(e){case"compositionend":return lf(n);case"keypress":return n.which!==32?null:(of=!0,sf);case"textInput":return e=n.data,e===sf&&of?null:e;default:return null}}function lw(e,n){if(ls)return e==="compositionend"||!Sl&&af(e,n)?(e=Jd(),bi=gl=Hn=null,ls=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:i,offset:n-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=mf(i)}}function yf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?yf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function vf(){for(var e=window,n=Xt();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=Xt(e.document)}return n}function kl(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function yw(e){var n=vf(),i=e.focusedElem,l=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&yf(i.ownerDocument.documentElement,i)){if(l!==null&&kl(i)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var c=i.textContent.length,f=Math.min(l.start,c);l=l.end===void 0?f:Math.min(l.end,c),!e.extend&&f>l&&(c=l,l=f,f=c),c=gf(i,f);var g=gf(i,l);c&&g&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==g.node||e.focusOffset!==g.offset)&&(n=n.createRange(),n.setStart(c.node,c.offset),e.removeAllRanges(),f>l?(e.addRange(n),e.extend(g.node,g.offset)):(n.setEnd(g.node,g.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i=document.documentMode,us=null,Cl=null,mo=null,Rl=!1;function wf(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Rl||us==null||us!==Xt(l)||(l=us,"selectionStart"in l&&kl(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),mo&&po(mo,l)||(mo=l,l=Ai(Cl,"onSelect"),0ps||(e.current=Ul[ps],Ul[ps]=null,ps--)}function Fe(e,n){ps++,Ul[ps]=e.current,e.current=n}var Kn={},ht=Qn(Kn),_t=Qn(!1),_r=Kn;function ms(e,n){var i=e.type.contextTypes;if(!i)return Kn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var c={},f;for(f in i)c[f]=n[f];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=c),c}function bt(e){return e=e.childContextTypes,e!=null}function Di(){ze(_t),ze(ht)}function If(e,n,i){if(ht.current!==Kn)throw Error(s(168));Fe(ht,n),Fe(_t,i)}function jf(e,n,i){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var c in l)if(!(c in n))throw Error(s(108,ve(e)||"Unknown",c));return U({},i,l)}function Mi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,_r=ht.current,Fe(ht,e),Fe(_t,_t.current),!0}function Df(e,n,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=jf(e,n,_r),l.__reactInternalMemoizedMergedChildContext=e,ze(_t),ze(ht),Fe(ht,e)):ze(_t),Fe(_t,i)}var bn=null,Fi=!1,zl=!1;function Mf(e){bn===null?bn=[e]:bn.push(e)}function Pw(e){Fi=!0,Mf(e)}function Gn(){if(!zl&&bn!==null){zl=!0;var e=0,n=De;try{var i=bn;for(De=1;e>=g,c-=g,kn=1<<32-Zt(n)+c|i<ge?(st=fe,fe=null):st=fe.sibling;var Le=H(j,fe,D[ge],Q);if(Le===null){fe===null&&(fe=st);break}e&&fe&&Le.alternate===null&&n(j,fe),T=f(Le,T,ge),de===null?le=Le:de.sibling=Le,de=Le,fe=st}if(ge===D.length)return i(j,fe),Be&&kr(j,ge),le;if(fe===null){for(;gege?(st=fe,fe=null):st=fe.sibling;var sr=H(j,fe,Le.value,Q);if(sr===null){fe===null&&(fe=st);break}e&&fe&&sr.alternate===null&&n(j,fe),T=f(sr,T,ge),de===null?le=sr:de.sibling=sr,de=sr,fe=st}if(Le.done)return i(j,fe),Be&&kr(j,ge),le;if(fe===null){for(;!Le.done;ge++,Le=D.next())Le=q(j,Le.value,Q),Le!==null&&(T=f(Le,T,ge),de===null?le=Le:de.sibling=Le,de=Le);return Be&&kr(j,ge),le}for(fe=l(j,fe);!Le.done;ge++,Le=D.next())Le=Z(fe,j,ge,Le.value,Q),Le!==null&&(e&&Le.alternate!==null&&fe.delete(Le.key===null?ge:Le.key),T=f(Le,T,ge),de===null?le=Le:de.sibling=Le,de=Le);return e&&fe.forEach(function(u0){return n(j,u0)}),Be&&kr(j,ge),le}function Qe(j,T,D,Q){if(typeof D=="object"&&D!==null&&D.type===G&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case V:e:{for(var le=D.key,de=T;de!==null;){if(de.key===le){if(le=D.type,le===G){if(de.tag===7){i(j,de.sibling),T=c(de,D.props.children),T.return=j,j=T;break e}}else if(de.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Se&&Vf(le)===de.type){i(j,de.sibling),T=c(de,D.props),T.ref=Eo(j,de,D),T.return=j,j=T;break e}i(j,de);break}else n(j,de);de=de.sibling}D.type===G?(T=Lr(D.props.children,j.mode,Q,D.key),T.return=j,j=T):(Q=fa(D.type,D.key,D.props,null,j.mode,Q),Q.ref=Eo(j,T,D),Q.return=j,j=Q)}return g(j);case $:e:{for(de=D.key;T!==null;){if(T.key===de)if(T.tag===4&&T.stateNode.containerInfo===D.containerInfo&&T.stateNode.implementation===D.implementation){i(j,T.sibling),T=c(T,D.children||[]),T.return=j,j=T;break e}else{i(j,T);break}else n(j,T);T=T.sibling}T=Mu(D,j.mode,Q),T.return=j,j=T}return g(j);case Se:return de=D._init,Qe(j,T,de(D._payload),Q)}if(Fn(D))return ne(j,T,D,Q);if(ae(D))return oe(j,T,D,Q);$i(j,D)}return typeof D=="string"&&D!==""||typeof D=="number"?(D=""+D,T!==null&&T.tag===6?(i(j,T.sibling),T=c(T,D),T.return=j,j=T):(i(j,T),T=Du(D,j.mode,Q),T.return=j,j=T),g(j)):i(j,T)}return Qe}var ws=Hf(!0),Wf=Hf(!1),Vi=Qn(null),Hi=null,xs=null,ql=null;function Ql(){ql=xs=Hi=null}function Kl(e){var n=Vi.current;ze(Vi),e._currentValue=n}function Gl(e,n,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===i)break;e=e.return}}function Es(e,n){Hi=e,ql=xs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(kt=!0),e.firstContext=null)}function Vt(e){var n=e._currentValue;if(ql!==e)if(e={context:e,memoizedValue:n,next:null},xs===null){if(Hi===null)throw Error(s(308));xs=e,Hi.dependencies={lanes:0,firstContext:e}}else xs=xs.next=e;return n}var Cr=null;function Xl(e){Cr===null?Cr=[e]:Cr.push(e)}function qf(e,n,i,l){var c=n.interleaved;return c===null?(i.next=i,Xl(n)):(i.next=c.next,c.next=i),n.interleaved=i,Rn(e,l)}function Rn(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Xn=!1;function Yl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Tn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Yn(e,n,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ae&2)!==0){var c=l.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),l.pending=n,Rn(e,i)}return c=l.interleaved,c===null?(n.next=n,Xl(l)):(n.next=c.next,c.next=n),l.interleaved=n,Rn(e,i)}function Wi(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,dl(e,i)}}function Kf(e,n){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var c=null,f=null;if(i=i.firstBaseUpdate,i!==null){do{var g={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};f===null?c=f=g:f=f.next=g,i=i.next}while(i!==null);f===null?c=f=n:f=f.next=n}else c=f=n;i={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function qi(e,n,i,l){var c=e.updateQueue;Xn=!1;var f=c.firstBaseUpdate,g=c.lastBaseUpdate,E=c.shared.pending;if(E!==null){c.shared.pending=null;var C=E,M=C.next;C.next=null,g===null?f=M:g.next=M,g=C;var W=e.alternate;W!==null&&(W=W.updateQueue,E=W.lastBaseUpdate,E!==g&&(E===null?W.firstBaseUpdate=M:E.next=M,W.lastBaseUpdate=C))}if(f!==null){var q=c.baseState;g=0,W=M=C=null,E=f;do{var H=E.lane,Z=E.eventTime;if((l&H)===H){W!==null&&(W=W.next={eventTime:Z,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var ne=e,oe=E;switch(H=n,Z=i,oe.tag){case 1:if(ne=oe.payload,typeof ne=="function"){q=ne.call(Z,q,H);break e}q=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=oe.payload,H=typeof ne=="function"?ne.call(Z,q,H):ne,H==null)break e;q=U({},q,H);break e;case 2:Xn=!0}}E.callback!==null&&E.lane!==0&&(e.flags|=64,H=c.effects,H===null?c.effects=[E]:H.push(E))}else Z={eventTime:Z,lane:H,tag:E.tag,payload:E.payload,callback:E.callback,next:null},W===null?(M=W=Z,C=q):W=W.next=Z,g|=H;if(E=E.next,E===null){if(E=c.shared.pending,E===null)break;H=E,E=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);if(W===null&&(C=q),c.baseState=C,c.firstBaseUpdate=M,c.lastBaseUpdate=W,n=c.shared.interleaved,n!==null){c=n;do g|=c.lane,c=c.next;while(c!==n)}else f===null&&(c.shared.lanes=0);Pr|=g,e.lanes=g,e.memoizedState=q}}function Gf(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;ni?i:4,e(!0);var l=nu.transition;nu.transition={};try{e(!1),n()}finally{De=i,nu.transition=l}}function ph(){return Ht().memoizedState}function Lw(e,n,i){var l=tr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},mh(e))gh(n,i);else if(i=qf(e,n,i,l),i!==null){var c=Et();on(i,e,l,c),yh(i,n,l)}}function Iw(e,n,i){var l=tr(e),c={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(mh(e))gh(n,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var g=n.lastRenderedState,E=f(g,i);if(c.hasEagerState=!0,c.eagerState=E,en(E,g)){var C=n.interleaved;C===null?(c.next=c,Xl(n)):(c.next=C.next,C.next=c),n.interleaved=c;return}}catch{}finally{}i=qf(e,n,c,l),i!==null&&(c=Et(),on(i,e,l,c),yh(i,n,l))}}function mh(e){var n=e.alternate;return e===Ve||n!==null&&n===Ve}function gh(e,n){ko=Gi=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function yh(e,n,i){if((i&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,dl(e,i)}}var Ji={readContext:Vt,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},jw={readContext:Vt,useCallback:function(e,n){return pn().memoizedState=[e,n===void 0?null:n],e},useContext:Vt,useEffect:ih,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,Xi(4194308,4,uh.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Xi(4194308,4,e,n)},useInsertionEffect:function(e,n){return Xi(4,2,e,n)},useMemo:function(e,n){var i=pn();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var l=pn();return n=i!==void 0?i(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=Lw.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var n=pn();return e={current:e},n.memoizedState=e},useState:sh,useDebugValue:uu,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=sh(!1),n=e[0];return e=Aw.bind(null,e[1]),pn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var l=Ve,c=pn();if(Be){if(i===void 0)throw Error(s(407));i=i()}else{if(i=n(),rt===null)throw Error(s(349));(Tr&30)!==0||Zf(l,n,i)}c.memoizedState=i;var f={value:i,getSnapshot:n};return c.queue=f,ih(th.bind(null,l,f,e),[e]),l.flags|=2048,To(9,eh.bind(null,l,f,i,n),void 0,null),i},useId:function(){var e=pn(),n=rt.identifierPrefix;if(Be){var i=Cn,l=kn;i=(l&~(1<<32-Zt(l)-1)).toString(32)+i,n=":"+n+"R"+i,i=Co++,0<\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=g.createElement(i,{is:l.is}):(e=g.createElement(i),i==="select"&&(g=e,l.multiple?g.multiple=!0:l.size&&(g.size=l.size))):e=g.createElementNS(e,i),e[fn]=n,e[wo]=l,Mh(e,n,!1,!1),n.stateNode=e;e:{switch(g=tl(i,l),i){case"dialog":Ue("cancel",e),Ue("close",e),c=l;break;case"iframe":case"object":case"embed":Ue("load",e),c=l;break;case"video":case"audio":for(c=0;cCs&&(n.flags|=128,l=!0,Po(f,!1),n.lanes=4194304)}else{if(!l)if(e=Qi(g),e!==null){if(n.flags|=128,l=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Po(f,!0),f.tail===null&&f.tailMode==="hidden"&&!g.alternate&&!Be)return mt(n),null}else 2*qe()-f.renderingStartTime>Cs&&i!==1073741824&&(n.flags|=128,l=!0,Po(f,!1),n.lanes=4194304);f.isBackwards?(g.sibling=n.child,n.child=g):(i=f.last,i!==null?i.sibling=g:n.child=g,f.last=g)}return f.tail!==null?(n=f.tail,f.rendering=n,f.tail=n.sibling,f.renderingStartTime=qe(),n.sibling=null,i=$e.current,Fe($e,l?i&1|2:i&1),n):(mt(n),null);case 22:case 23:return Lu(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(jt&1073741824)!==0&&(mt(n),n.subtreeFlags&6&&(n.flags|=8192)):mt(n),null;case 24:return null;case 25:return null}throw Error(s(156,n.tag))}function Vw(e,n){switch($l(n),n.tag){case 1:return bt(n.type)&&Di(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Ss(),ze(_t),ze(ht),tu(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Zl(n),null;case 13:if(ze($e),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));vs()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ze($e),null;case 4:return Ss(),null;case 10:return Kl(n.type._context),null;case 22:case 23:return Lu(),null;case 24:return null;default:return null}}var na=!1,gt=!1,Hw=typeof WeakSet=="function"?WeakSet:Set,te=null;function bs(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){He(e,n,l)}else i.current=null}function Eu(e,n,i){try{i()}catch(l){He(e,n,l)}}var zh=!1;function Ww(e,n){if(Ll=Si,e=vf(),kl(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var c=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{i.nodeType,f.nodeType}catch{i=null;break e}var g=0,E=-1,C=-1,M=0,W=0,q=e,H=null;t:for(;;){for(var Z;q!==i||c!==0&&q.nodeType!==3||(E=g+c),q!==f||l!==0&&q.nodeType!==3||(C=g+l),q.nodeType===3&&(g+=q.nodeValue.length),(Z=q.firstChild)!==null;)H=q,q=Z;for(;;){if(q===e)break t;if(H===i&&++M===c&&(E=g),H===f&&++W===l&&(C=g),(Z=q.nextSibling)!==null)break;q=H,H=q.parentNode}q=Z}i=E===-1||C===-1?null:{start:E,end:C}}else i=null}i=i||{start:0,end:0}}else i=null;for(Il={focusedElem:e,selectionRange:i},Si=!1,te=n;te!==null;)if(n=te,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,te=e;else for(;te!==null;){n=te;try{var ne=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var oe=ne.memoizedProps,Qe=ne.memoizedState,j=n.stateNode,T=j.getSnapshotBeforeUpdate(n.elementType===n.type?oe:nn(n.type,oe),Qe);j.__reactInternalSnapshotBeforeUpdate=T}break;case 3:var D=n.stateNode.containerInfo;D.nodeType===1?D.textContent="":D.nodeType===9&&D.documentElement&&D.removeChild(D.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(Q){He(n,n.return,Q)}if(e=n.sibling,e!==null){e.return=n.return,te=e;break}te=n.return}return ne=zh,zh=!1,ne}function No(e,n,i){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var c=l=l.next;do{if((c.tag&e)===e){var f=c.destroy;c.destroy=void 0,f!==void 0&&Eu(n,i,f)}c=c.next}while(c!==l)}}function ra(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==n)}}function Su(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function Bh(e){var n=e.alternate;n!==null&&(e.alternate=null,Bh(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[fn],delete n[wo],delete n[Fl],delete n[Rw],delete n[Tw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $h(e){return e.tag===5||e.tag===3||e.tag===4}function Vh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$h(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _u(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Ii));else if(l!==4&&(e=e.child,e!==null))for(_u(e,n,i),e=e.sibling;e!==null;)_u(e,n,i),e=e.sibling}function bu(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(bu(e,n,i),e=e.sibling;e!==null;)bu(e,n,i),e=e.sibling}var lt=null,rn=!1;function Jn(e,n,i){for(i=i.child;i!==null;)Hh(e,n,i),i=i.sibling}function Hh(e,n,i){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount(gi,i)}catch{}switch(i.tag){case 5:gt||bs(i,n);case 6:var l=lt,c=rn;lt=null,Jn(e,n,i),lt=l,rn=c,lt!==null&&(rn?(e=lt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):lt.removeChild(i.stateNode));break;case 18:lt!==null&&(rn?(e=lt,i=i.stateNode,e.nodeType===8?Ml(e.parentNode,i):e.nodeType===1&&Ml(e,i),ao(e)):Ml(lt,i.stateNode));break;case 4:l=lt,c=rn,lt=i.stateNode.containerInfo,rn=!0,Jn(e,n,i),lt=l,rn=c;break;case 0:case 11:case 14:case 15:if(!gt&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){c=l=l.next;do{var f=c,g=f.destroy;f=f.tag,g!==void 0&&((f&2)!==0||(f&4)!==0)&&Eu(i,n,g),c=c.next}while(c!==l)}Jn(e,n,i);break;case 1:if(!gt&&(bs(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(E){He(i,n,E)}Jn(e,n,i);break;case 21:Jn(e,n,i);break;case 22:i.mode&1?(gt=(l=gt)||i.memoizedState!==null,Jn(e,n,i),gt=l):Jn(e,n,i);break;default:Jn(e,n,i)}}function Wh(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Hw),n.forEach(function(l){var c=e0.bind(null,e,l);i.has(l)||(i.add(l),l.then(c,c))})}}function sn(e,n){var i=n.deletions;if(i!==null)for(var l=0;lc&&(c=g),l&=~f}if(l=c,l=qe()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Qw(l/1960))-l,10e?16:e,er===null)var l=!1;else{if(e=er,er=null,la=0,(Ae&6)!==0)throw Error(s(331));var c=Ae;for(Ae|=4,te=e.current;te!==null;){var f=te,g=f.child;if((te.flags&16)!==0){var E=f.deletions;if(E!==null){for(var C=0;Cqe()-Ru?Or(e,0):Cu|=i),Rt(e,n)}function sp(e,n){n===0&&((e.mode&1)===0?n=1:(n=vi,vi<<=1,(vi&130023424)===0&&(vi=4194304)));var i=Et();e=Rn(e,n),e!==null&&(no(e,n,i),Rt(e,i))}function Zw(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),sp(e,i)}function e0(e,n){var i=0;switch(e.tag){case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(n),sp(e,i)}var op;op=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||_t.current)kt=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return kt=!1,Bw(e,n,i);kt=(e.flags&131072)!==0}else kt=!1,Be&&(n.flags&1048576)!==0&&Ff(n,zi,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;ta(e,n),e=n.pendingProps;var c=ms(n,ht.current);Es(n,i),c=su(null,n,l,e,c,i);var f=ou();return n.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,bt(l)?(f=!0,Mi(n)):f=!1,n.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Yl(n),c.updater=Zi,n.stateNode=c,c._reactInternals=n,du(n,l,e,i),n=mu(null,n,l,!0,f,i)):(n.tag=0,Be&&f&&Bl(n),xt(null,n,c,i),n=n.child),n;case 16:l=n.elementType;e:{switch(ta(e,n),e=n.pendingProps,c=l._init,l=c(l._payload),n.type=l,c=n.tag=n0(l),e=nn(l,e),c){case 0:n=pu(null,n,l,e,i);break e;case 1:n=Oh(null,n,l,e,i);break e;case 11:n=Ch(null,n,l,e,i);break e;case 14:n=Rh(null,n,l,nn(l.type,e),i);break e}throw Error(s(306,l,""))}return n;case 0:return l=n.type,c=n.pendingProps,c=n.elementType===l?c:nn(l,c),pu(e,n,l,c,i);case 1:return l=n.type,c=n.pendingProps,c=n.elementType===l?c:nn(l,c),Oh(e,n,l,c,i);case 3:e:{if(Ah(n),e===null)throw Error(s(387));l=n.pendingProps,f=n.memoizedState,c=f.element,Qf(e,n),qi(n,l,null,i);var g=n.memoizedState;if(l=g.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){c=_s(Error(s(423)),n),n=Lh(e,n,l,i,c);break e}else if(l!==c){c=_s(Error(s(424)),n),n=Lh(e,n,l,i,c);break e}else for(It=qn(n.stateNode.containerInfo.firstChild),Lt=n,Be=!0,tn=null,i=Wf(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(vs(),l===c){n=Pn(e,n,i);break e}xt(e,n,l,i)}n=n.child}return n;case 5:return Xf(n),e===null&&Hl(n),l=n.type,c=n.pendingProps,f=e!==null?e.memoizedProps:null,g=c.children,jl(l,c)?g=null:f!==null&&jl(l,f)&&(n.flags|=32),Nh(e,n),xt(e,n,g,i),n.child;case 6:return e===null&&Hl(n),null;case 13:return Ih(e,n,i);case 4:return Jl(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=ws(n,null,l,i):xt(e,n,l,i),n.child;case 11:return l=n.type,c=n.pendingProps,c=n.elementType===l?c:nn(l,c),Ch(e,n,l,c,i);case 7:return xt(e,n,n.pendingProps,i),n.child;case 8:return xt(e,n,n.pendingProps.children,i),n.child;case 12:return xt(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(l=n.type._context,c=n.pendingProps,f=n.memoizedProps,g=c.value,Fe(Vi,l._currentValue),l._currentValue=g,f!==null)if(en(f.value,g)){if(f.children===c.children&&!_t.current){n=Pn(e,n,i);break e}}else for(f=n.child,f!==null&&(f.return=n);f!==null;){var E=f.dependencies;if(E!==null){g=f.child;for(var C=E.firstContext;C!==null;){if(C.context===l){if(f.tag===1){C=Tn(-1,i&-i),C.tag=2;var M=f.updateQueue;if(M!==null){M=M.shared;var W=M.pending;W===null?C.next=C:(C.next=W.next,W.next=C),M.pending=C}}f.lanes|=i,C=f.alternate,C!==null&&(C.lanes|=i),Gl(f.return,i,n),E.lanes|=i;break}C=C.next}}else if(f.tag===10)g=f.type===n.type?null:f.child;else if(f.tag===18){if(g=f.return,g===null)throw Error(s(341));g.lanes|=i,E=g.alternate,E!==null&&(E.lanes|=i),Gl(g,i,n),g=f.sibling}else g=f.child;if(g!==null)g.return=f;else for(g=f;g!==null;){if(g===n){g=null;break}if(f=g.sibling,f!==null){f.return=g.return,g=f;break}g=g.return}f=g}xt(e,n,c.children,i),n=n.child}return n;case 9:return c=n.type,l=n.pendingProps.children,Es(n,i),c=Vt(c),l=l(c),n.flags|=1,xt(e,n,l,i),n.child;case 14:return l=n.type,c=nn(l,n.pendingProps),c=nn(l.type,c),Rh(e,n,l,c,i);case 15:return Th(e,n,n.type,n.pendingProps,i);case 17:return l=n.type,c=n.pendingProps,c=n.elementType===l?c:nn(l,c),ta(e,n),n.tag=1,bt(l)?(e=!0,Mi(n)):e=!1,Es(n,i),wh(n,l,c),du(n,l,c,i),mu(null,n,l,!0,e,i);case 19:return Dh(e,n,i);case 22:return Ph(e,n,i)}throw Error(s(156,n.tag))};function ip(e,n){return Fd(e,n)}function t0(e,n,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,n,i,l){return new t0(e,n,i,l)}function ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function n0(e){if(typeof e=="function")return ju(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Te)return 11;if(e===_e)return 14}return 2}function rr(e,n){var i=e.alternate;return i===null?(i=qt(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function fa(e,n,i,l,c,f){var g=2;if(l=e,typeof e=="function")ju(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case G:return Lr(i.children,c,f,n);case B:g=8,c|=8;break;case ie:return e=qt(12,i,n,c|2),e.elementType=ie,e.lanes=f,e;case xe:return e=qt(13,i,n,c),e.elementType=xe,e.lanes=f,e;case J:return e=qt(19,i,n,c),e.elementType=J,e.lanes=f,e;case be:return ha(i,c,f,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:g=10;break e;case Ee:g=9;break e;case Te:g=11;break e;case _e:g=14;break e;case Se:g=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return n=qt(g,i,n,c),n.elementType=e,n.type=l,n.lanes=f,n}function Lr(e,n,i,l){return e=qt(7,e,l,n),e.lanes=i,e}function ha(e,n,i,l){return e=qt(22,e,l,n),e.elementType=be,e.lanes=i,e.stateNode={isHidden:!1},e}function Du(e,n,i){return e=qt(6,e,null,n),e.lanes=i,e}function Mu(e,n,i){return n=qt(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function r0(e,n,i,l,c){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cl(0),this.expirationTimes=cl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cl(0),this.identifierPrefix=l,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Fu(e,n,i,l,c,f,g,E,C){return e=new r0(e,n,i,E,C),n===1?(n=1,f===!0&&(n|=8)):n=0,f=qt(3,null,null,n),e.current=f,f.stateNode=e,f.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yl(f),e}function s0(e,n,i){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),Wu.exports=v0(),Wu.exports}var Ep;function w0(){if(Ep)return Ea;Ep=1;var r=ng();return Ea.createRoot=r.createRoot,Ea.hydrateRoot=r.hydrateRoot,Ea}var x0=w0();const E0=Wc(x0),S0=20,_0=1e6,Dn={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let Ku=0;function b0(){return Ku=(Ku+1)%Number.MAX_VALUE,Ku.toString()}const Gu=new Map,Sp=r=>{if(Gu.has(r))return;const t=setTimeout(()=>{Gu.delete(r),Wo({type:Dn.REMOVE_TOAST,toastId:r})},_0);Gu.set(r,t)},k0=(r,t)=>{switch(t.type){case Dn.ADD_TOAST:return{...r,toasts:[t.toast,...r.toasts].slice(0,S0)};case Dn.UPDATE_TOAST:return{...r,toasts:r.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case Dn.DISMISS_TOAST:{const{toastId:s}=t;return s?Sp(s):r.toasts.forEach(o=>{Sp(o.id)}),{...r,toasts:r.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o)}}case Dn.REMOVE_TOAST:return t.toastId===void 0?{...r,toasts:[]}:{...r,toasts:r.toasts.filter(s=>s.id!==t.toastId)}}},Oa=[];let Aa={toasts:[]};function Wo(r){Aa=k0(Aa,r),Oa.forEach(t=>{t(Aa)})}function C0({...r}){const t=b0(),s=a=>Wo({type:Dn.UPDATE_TOAST,toast:{...a,id:t}}),o=()=>Wo({type:Dn.DISMISS_TOAST,toastId:t});return Wo({type:Dn.ADD_TOAST,toast:{...r,id:t,open:!0,onOpenChange:a=>{a||o()}}}),{id:t,dismiss:o,update:s}}function R0(){const[r,t]=_.useState(Aa);return _.useEffect(()=>(Oa.push(t),()=>{const s=Oa.indexOf(t);s>-1&&Oa.splice(s,1)}),[r]),{...r,toast:C0,dismiss:s=>Wo({type:Dn.DISMISS_TOAST,toastId:s})}}var Qc=ng();const T0=Wc(Qc);function Dt(r,t,{checkForDefaultPrevented:s=!0}={}){return function(a){if(r==null||r(a),s===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function _p(r,t){if(typeof r=="function")return r(t);r!=null&&(r.current=t)}function Kc(...r){return t=>{let s=!1;const o=r.map(a=>{const u=_p(a,t);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let a=0;a{var S;const{scope:k,children:L,...F}=v,b=((S=k==null?void 0:k[r])==null?void 0:S[p])||h,x=_.useMemo(()=>F,Object.values(F));return w.jsx(b.Provider,{value:x,children:L})};m.displayName=u+"Provider";function y(v,k){var b;const L=((b=k==null?void 0:k[r])==null?void 0:b[p])||h,F=_.useContext(L);if(F)return F;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[m,y]}const a=()=>{const u=s.map(d=>_.createContext(d));return function(h){const p=(h==null?void 0:h[r])||u;return _.useMemo(()=>({[`__scope${r}`]:{...h,[r]:p}}),[h,p])}};return a.scopeName=r,[o,P0(a,...t)]}function P0(...r){const t=r[0];if(r.length===1)return t;const s=()=>{const o=r.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(u){const d=o.reduce((h,{useScope:p,scopeName:m})=>{const v=p(u)[`__scope${m}`];return{...h,...v}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}function bp(r){const t=N0(r),s=_.forwardRef((o,a)=>{const{children:u,...d}=o,h=_.Children.toArray(u),p=h.find(A0);if(p){const m=p.props.children,y=h.map(v=>v===p?_.Children.count(m)>1?_.Children.only(null):_.isValidElement(m)?m.props.children:null:v);return w.jsx(t,{...d,ref:a,children:_.isValidElement(m)?_.cloneElement(m,void 0,y):null})}return w.jsx(t,{...d,ref:a,children:u})});return s.displayName=`${r}.Slot`,s}function N0(r){const t=_.forwardRef((s,o)=>{const{children:a,...u}=s;if(_.isValidElement(a)){const d=I0(a),h=L0(u,a.props);return a.type!==_.Fragment&&(h.ref=o?Kc(o,d):d),_.cloneElement(a,h)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${r}.SlotClone`,t}var O0=Symbol("radix.slottable");function A0(r){return _.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===O0}function L0(r,t){const s={...t};for(const o in t){const a=r[o],u=t[o];/^on[A-Z]/.test(o)?a&&u?s[o]=(...h)=>{const p=u(...h);return a(...h),p}:a&&(s[o]=a):o==="style"?s[o]={...a,...u}:o==="className"&&(s[o]=[a,u].filter(Boolean).join(" "))}return{...r,...s}}function I0(r){var o,a;let t=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?r.ref:(t=(a=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?r.props.ref:r.props.ref||r.ref)}function j0(r){const t=r+"CollectionProvider",[s,o]=rg(t),[a,u]=s(t,{collectionRef:{current:null},itemMap:new Map}),d=b=>{const{scope:x,children:S}=b,I=Ln.useRef(null),P=Ln.useRef(new Map).current;return w.jsx(a,{scope:x,itemMap:P,collectionRef:I,children:S})};d.displayName=t;const h=r+"CollectionSlot",p=bp(h),m=Ln.forwardRef((b,x)=>{const{scope:S,children:I}=b,P=u(h,S),A=Xr(x,P.collectionRef);return w.jsx(p,{ref:A,children:I})});m.displayName=h;const y=r+"CollectionItemSlot",v="data-radix-collection-item",k=bp(y),L=Ln.forwardRef((b,x)=>{const{scope:S,children:I,...P}=b,A=Ln.useRef(null),V=Xr(x,A),$=u(y,S);return Ln.useEffect(()=>($.itemMap.set(A,{ref:A,...P}),()=>void $.itemMap.delete(A))),w.jsx(k,{[v]:"",ref:V,children:I})});L.displayName=y;function F(b){const x=u(r+"CollectionConsumer",b);return Ln.useCallback(()=>{const I=x.collectionRef.current;if(!I)return[];const P=Array.from(I.querySelectorAll(`[${v}]`));return Array.from(x.itemMap.values()).sort(($,G)=>P.indexOf($.ref.current)-P.indexOf(G.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:d,Slot:m,ItemSlot:L},F,o]}function D0(r){const t=M0(r),s=_.forwardRef((o,a)=>{const{children:u,...d}=o,h=_.Children.toArray(u),p=h.find(U0);if(p){const m=p.props.children,y=h.map(v=>v===p?_.Children.count(m)>1?_.Children.only(null):_.isValidElement(m)?m.props.children:null:v);return w.jsx(t,{...d,ref:a,children:_.isValidElement(m)?_.cloneElement(m,void 0,y):null})}return w.jsx(t,{...d,ref:a,children:u})});return s.displayName=`${r}.Slot`,s}function M0(r){const t=_.forwardRef((s,o)=>{const{children:a,...u}=s;if(_.isValidElement(a)){const d=B0(a),h=z0(u,a.props);return a.type!==_.Fragment&&(h.ref=o?Kc(o,d):d),_.cloneElement(a,h)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${r}.SlotClone`,t}var F0=Symbol("radix.slottable");function U0(r){return _.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===F0}function z0(r,t){const s={...t};for(const o in t){const a=r[o],u=t[o];/^on[A-Z]/.test(o)?a&&u?s[o]=(...h)=>{const p=u(...h);return a(...h),p}:a&&(s[o]=a):o==="style"?s[o]={...a,...u}:o==="className"&&(s[o]=[a,u].filter(Boolean).join(" "))}return{...r,...s}}function B0(r){var o,a;let t=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?r.ref:(t=(a=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?r.props.ref:r.props.ref||r.ref)}var $0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],En=$0.reduce((r,t)=>{const s=D0(`Primitive.${t}`),o=_.forwardRef((a,u)=>{const{asChild:d,...h}=a,p=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(p,{...h,ref:u})});return o.displayName=`Primitive.${t}`,{...r,[t]:o}},{});function sg(r,t){r&&Qc.flushSync(()=>r.dispatchEvent(t))}function Yr(r){const t=_.useRef(r);return _.useEffect(()=>{t.current=r}),_.useMemo(()=>(...s)=>{var o;return(o=t.current)==null?void 0:o.call(t,...s)},[])}function V0(r,t=globalThis==null?void 0:globalThis.document){const s=Yr(r);_.useEffect(()=>{const o=a=>{a.key==="Escape"&&s(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[s,t])}var H0="DismissableLayer",fc="dismissableLayer.update",W0="dismissableLayer.pointerDownOutside",q0="dismissableLayer.focusOutside",kp,og=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ig=_.forwardRef((r,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:d,onDismiss:h,...p}=r,m=_.useContext(og),[y,v]=_.useState(null),k=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,L]=_.useState({}),F=Xr(t,G=>v(G)),b=Array.from(m.layers),[x]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),I=y?b.indexOf(y):-1,P=m.layersWithOutsidePointerEventsDisabled.size>0,A=I>=S,V=K0(G=>{const B=G.target,ie=[...m.branches].some(ue=>ue.contains(B));!A||ie||(a==null||a(G),d==null||d(G),G.defaultPrevented||h==null||h())},k),$=G0(G=>{const B=G.target;[...m.branches].some(ue=>ue.contains(B))||(u==null||u(G),d==null||d(G),G.defaultPrevented||h==null||h())},k);return V0(G=>{I===m.layers.size-1&&(o==null||o(G),!G.defaultPrevented&&h&&(G.preventDefault(),h()))},k),_.useEffect(()=>{if(y)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(kp=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),Cp(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=kp)}},[y,k,s,m]),_.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),Cp())},[y,m]),_.useEffect(()=>{const G=()=>L({});return document.addEventListener(fc,G),()=>document.removeEventListener(fc,G)},[]),w.jsx(En.div,{...p,ref:F,style:{pointerEvents:P?A?"auto":"none":void 0,...r.style},onFocusCapture:Dt(r.onFocusCapture,$.onFocusCapture),onBlurCapture:Dt(r.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Dt(r.onPointerDownCapture,V.onPointerDownCapture)})});ig.displayName=H0;var Q0="DismissableLayerBranch",ag=_.forwardRef((r,t)=>{const s=_.useContext(og),o=_.useRef(null),a=Xr(t,o);return _.useEffect(()=>{const u=o.current;if(u)return s.branches.add(u),()=>{s.branches.delete(u)}},[s.branches]),w.jsx(En.div,{...r,ref:a})});ag.displayName=Q0;function K0(r,t=globalThis==null?void 0:globalThis.document){const s=Yr(r),o=_.useRef(!1),a=_.useRef(()=>{});return _.useEffect(()=>{const u=h=>{if(h.target&&!o.current){let p=function(){lg(W0,s,m,{discrete:!0})};const m={originalEvent:h};h.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=p,t.addEventListener("click",a.current,{once:!0})):p()}else t.removeEventListener("click",a.current);o.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",u),t.removeEventListener("click",a.current)}},[t,s]),{onPointerDownCapture:()=>o.current=!0}}function G0(r,t=globalThis==null?void 0:globalThis.document){const s=Yr(r),o=_.useRef(!1);return _.useEffect(()=>{const a=u=>{u.target&&!o.current&&lg(q0,s,{originalEvent:u},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,s]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Cp(){const r=new CustomEvent(fc);document.dispatchEvent(r)}function lg(r,t,s,{discrete:o}){const a=s.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:s});t&&a.addEventListener(r,t,{once:!0}),o?sg(a,u):a.dispatchEvent(u)}var X0=ig,Y0=ag,Qo=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},J0="Portal",ug=_.forwardRef((r,t)=>{var h;const{container:s,...o}=r,[a,u]=_.useState(!1);Qo(()=>u(!0),[]);const d=s||a&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return d?T0.createPortal(w.jsx(En.div,{...o,ref:t}),d):null});ug.displayName=J0;function Z0(r,t){return _.useReducer((s,o)=>t[s][o]??s,r)}var cg=r=>{const{present:t,children:s}=r,o=ex(t),a=typeof s=="function"?s({present:o.isPresent}):_.Children.only(s),u=Xr(o.ref,tx(a));return typeof s=="function"||o.isPresent?_.cloneElement(a,{ref:u}):null};cg.displayName="Presence";function ex(r){const[t,s]=_.useState(),o=_.useRef(null),a=_.useRef(r),u=_.useRef("none"),d=r?"mounted":"unmounted",[h,p]=Z0(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Sa(o.current);u.current=h==="mounted"?m:"none"},[h]),Qo(()=>{const m=o.current,y=a.current;if(y!==r){const k=u.current,L=Sa(m);r?p("MOUNT"):L==="none"||(m==null?void 0:m.display)==="none"?p("UNMOUNT"):p(y&&k!==L?"ANIMATION_OUT":"UNMOUNT"),a.current=r}},[r,p]),Qo(()=>{if(t){let m;const y=t.ownerDocument.defaultView??window,v=L=>{const b=Sa(o.current).includes(CSS.escape(L.animationName));if(L.target===t&&b&&(p("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",m=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},k=L=>{L.target===t&&(u.current=Sa(o.current))};return t.addEventListener("animationstart",k),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{y.clearTimeout(m),t.removeEventListener("animationstart",k),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:_.useCallback(m=>{o.current=m?getComputedStyle(m):null,s(m)},[])}}function Sa(r){return(r==null?void 0:r.animationName)||"none"}function tx(r){var o,a;let t=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?r.ref:(t=(a=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?r.props.ref:r.props.ref||r.ref)}var nx=tg[" useInsertionEffect ".trim().toString()]||Qo;function rx({prop:r,defaultProp:t,onChange:s=()=>{},caller:o}){const[a,u,d]=sx({defaultProp:t,onChange:s}),h=r!==void 0,p=h?r:a;{const y=_.useRef(r!==void 0);_.useEffect(()=>{const v=y.current;v!==h&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=h},[h,o])}const m=_.useCallback(y=>{var v;if(h){const k=ox(y)?y(r):y;k!==r&&((v=d.current)==null||v.call(d,k))}else u(y)},[h,r,u,d]);return[p,m]}function sx({defaultProp:r,onChange:t}){const[s,o]=_.useState(r),a=_.useRef(s),u=_.useRef(t);return nx(()=>{u.current=t},[t]),_.useEffect(()=>{var d;a.current!==s&&((d=u.current)==null||d.call(u,s),a.current=s)},[s,a]),[s,o,u]}function ox(r){return typeof r=="function"}var ix=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ax="VisuallyHidden",Gc=_.forwardRef((r,t)=>w.jsx(En.span,{...r,ref:t,style:{...ix,...r.style}}));Gc.displayName=ax;var Xc="ToastProvider",[Yc,lx,ux]=j0("Toast"),[dg]=rg("Toast",[ux]),[cx,Qa]=dg(Xc),fg=r=>{const{__scopeToast:t,label:s="Notification",duration:o=5e3,swipeDirection:a="right",swipeThreshold:u=50,children:d}=r,[h,p]=_.useState(null),[m,y]=_.useState(0),v=_.useRef(!1),k=_.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${Xc}\`. Expected non-empty \`string\`.`),w.jsx(Yc.Provider,{scope:t,children:w.jsx(cx,{scope:t,label:s,duration:o,swipeDirection:a,swipeThreshold:u,toastCount:m,viewport:h,onViewportChange:p,onToastAdd:_.useCallback(()=>y(L=>L+1),[]),onToastRemove:_.useCallback(()=>y(L=>L-1),[]),isFocusedToastEscapeKeyDownRef:v,isClosePausedRef:k,children:d})})};fg.displayName=Xc;var hg="ToastViewport",dx=["F8"],hc="toast.viewportPause",pc="toast.viewportResume",pg=_.forwardRef((r,t)=>{const{__scopeToast:s,hotkey:o=dx,label:a="Notifications ({hotkey})",...u}=r,d=Qa(hg,s),h=lx(s),p=_.useRef(null),m=_.useRef(null),y=_.useRef(null),v=_.useRef(null),k=Xr(t,v,d.onViewportChange),L=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=d.toastCount>0;_.useEffect(()=>{const x=S=>{var P;o.length!==0&&o.every(A=>S[A]||S.code===A)&&((P=v.current)==null||P.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[o]),_.useEffect(()=>{const x=p.current,S=v.current;if(F&&x&&S){const I=()=>{if(!d.isClosePausedRef.current){const $=new CustomEvent(hc);S.dispatchEvent($),d.isClosePausedRef.current=!0}},P=()=>{if(d.isClosePausedRef.current){const $=new CustomEvent(pc);S.dispatchEvent($),d.isClosePausedRef.current=!1}},A=$=>{!x.contains($.relatedTarget)&&P()},V=()=>{x.contains(document.activeElement)||P()};return x.addEventListener("focusin",I),x.addEventListener("focusout",A),x.addEventListener("pointermove",I),x.addEventListener("pointerleave",V),window.addEventListener("blur",I),window.addEventListener("focus",P),()=>{x.removeEventListener("focusin",I),x.removeEventListener("focusout",A),x.removeEventListener("pointermove",I),x.removeEventListener("pointerleave",V),window.removeEventListener("blur",I),window.removeEventListener("focus",P)}}},[F,d.isClosePausedRef]);const b=_.useCallback(({tabbingDirection:x})=>{const I=h().map(P=>{const A=P.ref.current,V=[A,...bx(A)];return x==="forwards"?V:V.reverse()});return(x==="forwards"?I.reverse():I).flat()},[h]);return _.useEffect(()=>{const x=v.current;if(x){const S=I=>{var V,$,G;const P=I.altKey||I.ctrlKey||I.metaKey;if(I.key==="Tab"&&!P){const B=document.activeElement,ie=I.shiftKey;if(I.target===x&&ie){(V=m.current)==null||V.focus();return}const Te=b({tabbingDirection:ie?"backwards":"forwards"}),xe=Te.findIndex(J=>J===B);Xu(Te.slice(xe+1))?I.preventDefault():ie?($=m.current)==null||$.focus():(G=y.current)==null||G.focus()}};return x.addEventListener("keydown",S),()=>x.removeEventListener("keydown",S)}},[h,b]),w.jsxs(Y0,{ref:p,role:"region","aria-label":a.replace("{hotkey}",L),tabIndex:-1,style:{pointerEvents:F?void 0:"none"},children:[F&&w.jsx(mc,{ref:m,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"forwards"});Xu(x)}}),w.jsx(Yc.Slot,{scope:s,children:w.jsx(En.ol,{tabIndex:-1,...u,ref:k})}),F&&w.jsx(mc,{ref:y,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"backwards"});Xu(x)}})]})});pg.displayName=hg;var mg="ToastFocusProxy",mc=_.forwardRef((r,t)=>{const{__scopeToast:s,onFocusFromOutsideViewport:o,...a}=r,u=Qa(mg,s);return w.jsx(Gc,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:d=>{var m;const h=d.relatedTarget;!((m=u.viewport)!=null&&m.contains(h))&&o()}})});mc.displayName=mg;var si="Toast",fx="toast.swipeStart",hx="toast.swipeMove",px="toast.swipeCancel",mx="toast.swipeEnd",gg=_.forwardRef((r,t)=>{const{forceMount:s,open:o,defaultOpen:a,onOpenChange:u,...d}=r,[h,p]=rx({prop:o,defaultProp:a??!0,onChange:u,caller:si});return w.jsx(cg,{present:s||h,children:w.jsx(vx,{open:h,...d,ref:t,onClose:()=>p(!1),onPause:Yr(r.onPause),onResume:Yr(r.onResume),onSwipeStart:Dt(r.onSwipeStart,m=>{m.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Dt(r.onSwipeMove,m=>{const{x:y,y:v}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","move"),m.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${y}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${v}px`)}),onSwipeCancel:Dt(r.onSwipeCancel,m=>{m.currentTarget.setAttribute("data-swipe","cancel"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Dt(r.onSwipeEnd,m=>{const{x:y,y:v}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","end"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${y}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${v}px`),p(!1)})})})});gg.displayName=si;var[gx,yx]=dg(si,{onClose(){}}),vx=_.forwardRef((r,t)=>{const{__scopeToast:s,type:o="foreground",duration:a,open:u,onClose:d,onEscapeKeyDown:h,onPause:p,onResume:m,onSwipeStart:y,onSwipeMove:v,onSwipeCancel:k,onSwipeEnd:L,...F}=r,b=Qa(si,s),[x,S]=_.useState(null),I=Xr(t,J=>S(J)),P=_.useRef(null),A=_.useRef(null),V=a||b.duration,$=_.useRef(0),G=_.useRef(V),B=_.useRef(0),{onToastAdd:ie,onToastRemove:ue}=b,Ee=Yr(()=>{var _e;(x==null?void 0:x.contains(document.activeElement))&&((_e=b.viewport)==null||_e.focus()),d()}),Te=_.useCallback(J=>{!J||J===1/0||(window.clearTimeout(B.current),$.current=new Date().getTime(),B.current=window.setTimeout(Ee,J))},[Ee]);_.useEffect(()=>{const J=b.viewport;if(J){const _e=()=>{Te(G.current),m==null||m()},Se=()=>{const be=new Date().getTime()-$.current;G.current=G.current-be,window.clearTimeout(B.current),p==null||p()};return J.addEventListener(hc,Se),J.addEventListener(pc,_e),()=>{J.removeEventListener(hc,Se),J.removeEventListener(pc,_e)}}},[b.viewport,V,p,m,Te]),_.useEffect(()=>{u&&!b.isClosePausedRef.current&&Te(V)},[u,V,b.isClosePausedRef,Te]),_.useEffect(()=>(ie(),()=>ue()),[ie,ue]);const xe=_.useMemo(()=>x?_g(x):null,[x]);return b.viewport?w.jsxs(w.Fragment,{children:[xe&&w.jsx(wx,{__scopeToast:s,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:xe}),w.jsx(gx,{scope:s,onClose:Ee,children:Qc.createPortal(w.jsx(Yc.ItemSlot,{scope:s,children:w.jsx(X0,{asChild:!0,onEscapeKeyDown:Dt(h,()=>{b.isFocusedToastEscapeKeyDownRef.current||Ee(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(En.li,{tabIndex:0,"data-state":u?"open":"closed","data-swipe-direction":b.swipeDirection,...F,ref:I,style:{userSelect:"none",touchAction:"none",...r.style},onKeyDown:Dt(r.onKeyDown,J=>{J.key==="Escape"&&(h==null||h(J.nativeEvent),J.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,Ee()))}),onPointerDown:Dt(r.onPointerDown,J=>{J.button===0&&(P.current={x:J.clientX,y:J.clientY})}),onPointerMove:Dt(r.onPointerMove,J=>{if(!P.current)return;const _e=J.clientX-P.current.x,Se=J.clientY-P.current.y,be=!!A.current,K=["left","right"].includes(b.swipeDirection),ae=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,U=K?ae(0,_e):0,N=K?0:ae(0,Se),z=J.pointerType==="touch"?10:2,ce={x:U,y:N},me={originalEvent:J,delta:ce};be?(A.current=ce,_a(hx,v,me,{discrete:!1})):Rp(ce,b.swipeDirection,z)?(A.current=ce,_a(fx,y,me,{discrete:!1}),J.target.setPointerCapture(J.pointerId)):(Math.abs(_e)>z||Math.abs(Se)>z)&&(P.current=null)}),onPointerUp:Dt(r.onPointerUp,J=>{const _e=A.current,Se=J.target;if(Se.hasPointerCapture(J.pointerId)&&Se.releasePointerCapture(J.pointerId),A.current=null,P.current=null,_e){const be=J.currentTarget,K={originalEvent:J,delta:_e};Rp(_e,b.swipeDirection,b.swipeThreshold)?_a(mx,L,K,{discrete:!0}):_a(px,k,K,{discrete:!0}),be.addEventListener("click",ae=>ae.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),wx=r=>{const{__scopeToast:t,children:s,...o}=r,a=Qa(si,t),[u,d]=_.useState(!1),[h,p]=_.useState(!1);return Sx(()=>d(!0)),_.useEffect(()=>{const m=window.setTimeout(()=>p(!0),1e3);return()=>window.clearTimeout(m)},[]),h?null:w.jsx(ug,{asChild:!0,children:w.jsx(Gc,{...o,children:u&&w.jsxs(w.Fragment,{children:[a.label," ",s]})})})},xx="ToastTitle",yg=_.forwardRef((r,t)=>{const{__scopeToast:s,...o}=r;return w.jsx(En.div,{...o,ref:t})});yg.displayName=xx;var Ex="ToastDescription",vg=_.forwardRef((r,t)=>{const{__scopeToast:s,...o}=r;return w.jsx(En.div,{...o,ref:t})});vg.displayName=Ex;var wg="ToastAction",xg=_.forwardRef((r,t)=>{const{altText:s,...o}=r;return s.trim()?w.jsx(Sg,{altText:s,asChild:!0,children:w.jsx(Jc,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${wg}\`. Expected non-empty \`string\`.`),null)});xg.displayName=wg;var Eg="ToastClose",Jc=_.forwardRef((r,t)=>{const{__scopeToast:s,...o}=r,a=yx(Eg,s);return w.jsx(Sg,{asChild:!0,children:w.jsx(En.button,{type:"button",...o,ref:t,onClick:Dt(r.onClick,a.onClose)})})});Jc.displayName=Eg;var Sg=_.forwardRef((r,t)=>{const{__scopeToast:s,altText:o,...a}=r;return w.jsx(En.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...a,ref:t})});function _g(r){const t=[];return Array.from(r.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),_x(o)){const a=o.ariaHidden||o.hidden||o.style.display==="none",u=o.dataset.radixToastAnnounceExclude==="";if(!a)if(u){const d=o.dataset.radixToastAnnounceAlt;d&&t.push(d)}else t.push(..._g(o))}}),t}function _a(r,t,s,{discrete:o}){const a=s.originalEvent.currentTarget,u=new CustomEvent(r,{bubbles:!0,cancelable:!0,detail:s});t&&a.addEventListener(r,t,{once:!0}),o?sg(a,u):a.dispatchEvent(u)}var Rp=(r,t,s=0)=>{const o=Math.abs(r.x),a=Math.abs(r.y),u=o>a;return t==="left"||t==="right"?u&&o>s:!u&&a>s};function Sx(r=()=>{}){const t=Yr(r);Qo(()=>{let s=0,o=0;return s=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(o)}},[t])}function _x(r){return r.nodeType===r.ELEMENT_NODE}function bx(r){const t=[],s=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Xu(r){const t=document.activeElement;return r.some(s=>s===t?!0:(s.focus(),document.activeElement!==t))}var kx=fg,bg=pg,kg=gg,Cg=yg,Rg=vg,Tg=xg,Pg=Jc;function Ng(r){var t,s,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var a=r.length;for(t=0;ttypeof r=="boolean"?`${r}`:r===0?"0":r,Pp=Og,Cx=(r,t)=>s=>{var o;if((t==null?void 0:t.variants)==null)return Pp(r,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:a,defaultVariants:u}=t,d=Object.keys(a).map(m=>{const y=s==null?void 0:s[m],v=u==null?void 0:u[m];if(y===null)return null;const k=Tp(y)||Tp(v);return a[m][k]}),h=s&&Object.entries(s).reduce((m,y)=>{let[v,k]=y;return k===void 0||(m[v]=k),m},{}),p=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((m,y)=>{let{class:v,className:k,...L}=y;return Object.entries(L).every(F=>{let[b,x]=F;return Array.isArray(x)?x.includes({...u,...h}[b]):{...u,...h}[b]===x})?[...m,v,k]:m},[]);return Pp(r,d,p,s==null?void 0:s.class,s==null?void 0:s.className)};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rx=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ag=(...r)=>r.filter((t,s,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===s).join(" ").trim();/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Tx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Px=_.forwardRef(({color:r="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:d,...h},p)=>_.createElement("svg",{ref:p,...Tx,width:t,height:t,stroke:r,strokeWidth:o?Number(s)*24/Number(t):s,className:Ag("lucide",a),...h},[...d.map(([m,y])=>_.createElement(m,y)),...Array.isArray(u)?u:[u]]));/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mt=(r,t)=>{const s=_.forwardRef(({className:o,...a},u)=>_.createElement(Px,{ref:u,iconNode:t,className:Ag(`lucide-${Rx(r)}`,o),...a}));return s.displayName=`${r}`,s};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nx=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Lg=Mt("ArrowRight",Nx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ox=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ax=Mt("Check",Ox);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lx=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ix=Mt("ChevronDown",Lx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jx=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dx=Mt("ChevronRight",jx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mx=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],Fx=Mt("Facebook",Mx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ux=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],zx=Mt("Link2",Ux);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bx=[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]],$x=Mt("Linkedin",Bx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vx=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],Hx=Mt("Mail",Vx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wx=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],qx=Mt("Menu",Wx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qx=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Kx=Mt("Printer",Qx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gx=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Xx=Mt("Search",Gx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yx=[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]],Jx=Mt("Twitter",Yx);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zx=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ig=Mt("X",Zx),e1=(r,t)=>{const s=new Array(r.length+t.length);for(let o=0;o({classGroupId:r,validator:t}),jg=(r=new Map,t=null,s)=>({nextPart:r,validators:t,classGroupId:s}),Ba="-",Np=[],n1="arbitrary..",r1=r=>{const t=o1(r),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return s1(d);const h=d.split(Ba),p=h[0]===""&&h.length>1?1:0;return Dg(h,p,t)},getConflictingClassGroupIds:(d,h)=>{if(h){const p=o[d],m=s[d];return p?m?e1(m,p):p:m||Np}return s[d]||Np}}},Dg=(r,t,s)=>{if(r.length-t===0)return s.classGroupId;const a=r[t],u=s.nextPart.get(a);if(u){const m=Dg(r,t+1,u);if(m)return m}const d=s.validators;if(d===null)return;const h=t===0?r.join(Ba):r.slice(t).join(Ba),p=d.length;for(let m=0;mr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=r.slice(1,-1),s=t.indexOf(":"),o=t.slice(0,s);return o?n1+o:void 0})(),o1=r=>{const{theme:t,classGroups:s}=r;return i1(s,t)},i1=(r,t)=>{const s=jg();for(const o in r){const a=r[o];Zc(a,s,o,t)}return s},Zc=(r,t,s,o)=>{const a=r.length;for(let u=0;u{if(typeof r=="string"){l1(r,t,s);return}if(typeof r=="function"){u1(r,t,s,o);return}c1(r,t,s,o)},l1=(r,t,s)=>{const o=r===""?t:Mg(t,r);o.classGroupId=s},u1=(r,t,s,o)=>{if(d1(r)){Zc(r(o),t,s,o);return}t.validators===null&&(t.validators=[]),t.validators.push(t1(s,r))},c1=(r,t,s,o)=>{const a=Object.entries(r),u=a.length;for(let d=0;d{let s=r;const o=t.split(Ba),a=o.length;for(let u=0;u"isThemeGetter"in r&&r.isThemeGetter===!0,f1=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),o=Object.create(null);const a=(u,d)=>{s[u]=d,t++,t>r&&(t=0,o=s,s=Object.create(null))};return{get(u){let d=s[u];if(d!==void 0)return d;if((d=o[u])!==void 0)return a(u,d),d},set(u,d){u in s?s[u]=d:a(u,d)}}},gc="!",Op=":",h1=[],Ap=(r,t,s,o,a)=>({modifiers:r,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:o,isExternal:a}),p1=r=>{const{prefix:t,experimentalParseClassName:s}=r;let o=a=>{const u=[];let d=0,h=0,p=0,m;const y=a.length;for(let b=0;bp?m-p:void 0;return Ap(u,L,k,F)};if(t){const a=t+Op,u=o;o=d=>d.startsWith(a)?u(d.slice(a.length)):Ap(h1,!1,d,void 0,!0)}if(s){const a=o;o=u=>s({className:u,parseClassName:a})}return o},m1=r=>{const t=new Map;return r.orderSensitiveModifiers.forEach((s,o)=>{t.set(s,1e6+o)}),s=>{const o=[];let a=[];for(let u=0;u0&&(a.sort(),o.push(...a),a=[]),o.push(d)):a.push(d)}return a.length>0&&(a.sort(),o.push(...a)),o}},g1=r=>({cache:f1(r.cacheSize),parseClassName:p1(r),sortModifiers:m1(r),...r1(r)}),y1=/\s+/,v1=(r,t)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:u}=t,d=[],h=r.trim().split(y1);let p="";for(let m=h.length-1;m>=0;m-=1){const y=h[m],{isExternal:v,modifiers:k,hasImportantModifier:L,baseClassName:F,maybePostfixModifierPosition:b}=s(y);if(v){p=y+(p.length>0?" "+p:p);continue}let x=!!b,S=o(x?F.substring(0,b):F);if(!S){if(!x){p=y+(p.length>0?" "+p:p);continue}if(S=o(F),!S){p=y+(p.length>0?" "+p:p);continue}x=!1}const I=k.length===0?"":k.length===1?k[0]:u(k).join(":"),P=L?I+gc:I,A=P+S;if(d.indexOf(A)>-1)continue;d.push(A);const V=a(S,x);for(let $=0;$0?" "+p:p)}return p},w1=(...r)=>{let t=0,s,o,a="";for(;t{if(typeof r=="string")return r;let t,s="";for(let o=0;o{let s,o,a,u;const d=p=>{const m=t.reduce((y,v)=>v(y),r());return s=g1(m),o=s.cache.get,a=s.cache.set,u=h,h(p)},h=p=>{const m=o(p);if(m)return m;const y=v1(p,s);return a(p,y),y};return u=d,(...p)=>u(w1(...p))},E1=[],et=r=>{const t=s=>s[r]||E1;return t.isThemeGetter=!0,t},Ug=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,S1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,C1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=r=>S1.test(r),ke=r=>!!r&&!Number.isNaN(Number(r)),ir=r=>!!r&&Number.isInteger(Number(r)),Yu=r=>r.endsWith("%")&&ke(r.slice(0,-1)),On=r=>_1.test(r),Bg=()=>!0,T1=r=>b1.test(r)&&!k1.test(r),ed=()=>!1,P1=r=>C1.test(r),N1=r=>R1.test(r),O1=r=>!re(r)&&!se(r),A1=r=>xr(r,Hg,ed),re=r=>Ug.test(r),Ir=r=>xr(r,Wg,T1),Lp=r=>xr(r,z1,ke),L1=r=>xr(r,Qg,Bg),I1=r=>xr(r,qg,ed),Ip=r=>xr(r,$g,ed),j1=r=>xr(r,Vg,N1),ba=r=>xr(r,Kg,P1),se=r=>zg.test(r),Do=r=>ts(r,Wg),D1=r=>ts(r,qg),jp=r=>ts(r,$g),M1=r=>ts(r,Hg),F1=r=>ts(r,Vg),ka=r=>ts(r,Kg,!0),U1=r=>ts(r,Qg,!0),xr=(r,t,s)=>{const o=Ug.exec(r);return o?o[1]?t(o[1]):s(o[2]):!1},ts=(r,t,s=!1)=>{const o=zg.exec(r);return o?o[1]?t(o[1]):s:!1},$g=r=>r==="position"||r==="percentage",Vg=r=>r==="image"||r==="url",Hg=r=>r==="length"||r==="size"||r==="bg-size",Wg=r=>r==="length",z1=r=>r==="number",qg=r=>r==="family-name",Qg=r=>r==="number"||r==="weight",Kg=r=>r==="shadow",B1=()=>{const r=et("color"),t=et("font"),s=et("text"),o=et("font-weight"),a=et("tracking"),u=et("leading"),d=et("breakpoint"),h=et("container"),p=et("spacing"),m=et("radius"),y=et("shadow"),v=et("inset-shadow"),k=et("text-shadow"),L=et("drop-shadow"),F=et("blur"),b=et("perspective"),x=et("aspect"),S=et("ease"),I=et("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],V=()=>[...A(),se,re],$=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto","contain","none"],B=()=>[se,re,p],ie=()=>[or,"full","auto",...B()],ue=()=>[ir,"none","subgrid",se,re],Ee=()=>["auto",{span:["full",ir,se,re]},ir,se,re],Te=()=>[ir,"auto",se,re],xe=()=>["auto","min","max","fr",se,re],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],_e=()=>["start","end","center","stretch","center-safe","end-safe"],Se=()=>["auto",...B()],be=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],K=()=>[or,"screen","full","dvw","lvw","svw","min","max","fit",...B()],ae=()=>[or,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],U=()=>[r,se,re],N=()=>[...A(),jp,Ip,{position:[se,re]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ce=()=>["auto","cover","contain",M1,A1,{size:[se,re]}],me=()=>[Yu,Do,Ir],he=()=>["","none","full",m,se,re],X=()=>["",ke,Do,Ir],ve=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[ke,Yu,jp,Ip],tt=()=>["","none",F,se,re],Ft=()=>["none",ke,se,re],it=()=>["none",ke,se,re],Xt=()=>[ke,se,re],Ut=()=>[or,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[On],breakpoint:[On],color:[Bg],container:[On],"drop-shadow":[On],ease:["in","out","in-out"],font:[O1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[On],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[On],shadow:[On],spacing:["px",ke],text:[On],"text-shadow":[On],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,re,se,x]}],container:["container"],columns:[{columns:[ke,re,se,h]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:V()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ie()}],"inset-x":[{"inset-x":ie()}],"inset-y":[{"inset-y":ie()}],start:[{"inset-s":ie(),start:ie()}],end:[{"inset-e":ie(),end:ie()}],"inset-bs":[{"inset-bs":ie()}],"inset-be":[{"inset-be":ie()}],top:[{top:ie()}],right:[{right:ie()}],bottom:[{bottom:ie()}],left:[{left:ie()}],visibility:["visible","invisible","collapse"],z:[{z:[ir,"auto",se,re]}],basis:[{basis:[or,"full","auto",h,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,or,"auto","initial","none",re]}],grow:[{grow:["",ke,se,re]}],shrink:[{shrink:["",ke,se,re]}],order:[{order:[ir,"first","last","none",se,re]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:Ee()}],"col-start":[{"col-start":Te()}],"col-end":[{"col-end":Te()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:Ee()}],"row-start":[{"row-start":Te()}],"row-end":[{"row-end":Te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":xe()}],"auto-rows":[{"auto-rows":xe()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[..._e(),"normal"]}],"justify-self":[{"justify-self":["auto",..._e()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[..._e(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._e(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[..._e(),"baseline"]}],"place-self":[{"place-self":["auto",..._e()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:Se()}],mx:[{mx:Se()}],my:[{my:Se()}],ms:[{ms:Se()}],me:[{me:Se()}],mbs:[{mbs:Se()}],mbe:[{mbe:Se()}],mt:[{mt:Se()}],mr:[{mr:Se()}],mb:[{mb:Se()}],ml:[{ml:Se()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:be()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[h,"screen",...be()]}],"min-w":[{"min-w":[h,"screen","none",...be()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...be()]}],h:[{h:["screen","lh",...be()]}],"min-h":[{"min-h":["screen","lh","none",...be()]}],"max-h":[{"max-h":["screen","lh",...be()]}],"font-size":[{text:["base",s,Do,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,U1,L1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yu,re]}],"font-family":[{font:[D1,I1,t]}],"font-features":[{"font-features":[re]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,se,re]}],"line-clamp":[{"line-clamp":[ke,"none",se,Lp]}],leading:[{leading:[u,...B()]}],"list-image":[{"list-image":["none",se,re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",se,Ir]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[ke,"auto",se,re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se,re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ir,se,re],radial:["",se,re],conic:[ir,se,re]},F1,j1]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,se,re]}],"outline-w":[{outline:["",ke,Do,Ir]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",y,ka,ba]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",v,ka,ba]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[ke,Ir]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",k,ka,ba]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[ke,se,re]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[se,re]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,re]}],filter:[{filter:["","none",se,re]}],blur:[{blur:tt()}],brightness:[{brightness:[ke,se,re]}],contrast:[{contrast:[ke,se,re]}],"drop-shadow":[{"drop-shadow":["","none",L,ka,ba]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",ke,se,re]}],"hue-rotate":[{"hue-rotate":[ke,se,re]}],invert:[{invert:["",ke,se,re]}],saturate:[{saturate:[ke,se,re]}],sepia:[{sepia:["",ke,se,re]}],"backdrop-filter":[{"backdrop-filter":["","none",se,re]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[ke,se,re]}],"backdrop-contrast":[{"backdrop-contrast":[ke,se,re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,se,re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,se,re]}],"backdrop-invert":[{"backdrop-invert":["",ke,se,re]}],"backdrop-opacity":[{"backdrop-opacity":[ke,se,re]}],"backdrop-saturate":[{"backdrop-saturate":[ke,se,re]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,se,re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",se,re]}],ease:[{ease:["linear","initial",S,se,re]}],delay:[{delay:[ke,se,re]}],animate:[{animate:["none",I,se,re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,se,re]}],"perspective-origin":[{"perspective-origin":V()}],rotate:[{rotate:Ft()}],"rotate-x":[{"rotate-x":Ft()}],"rotate-y":[{"rotate-y":Ft()}],"rotate-z":[{"rotate-z":Ft()}],scale:[{scale:it()}],"scale-x":[{"scale-x":it()}],"scale-y":[{"scale-y":it()}],"scale-z":[{"scale-z":it()}],"scale-3d":["scale-3d"],skew:[{skew:Xt()}],"skew-x":[{"skew-x":Xt()}],"skew-y":[{"skew-y":Xt()}],transform:[{transform:[se,re,"","none","gpu","cpu"]}],"transform-origin":[{origin:V()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ut()}],"translate-x":[{"translate-x":Ut()}],"translate-y":[{"translate-y":Ut()}],"translate-z":[{"translate-z":Ut()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se,re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se,re]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[ke,Do,Ir,Lp]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$1=x1(B1);function Hs(...r){return $1(Og(r))}const V1=kx,Gg=_.forwardRef(({className:r,...t},s)=>w.jsx(bg,{ref:s,className:Hs("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",r),...t}));Gg.displayName=bg.displayName;const H1=Cx("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Xg=_.forwardRef(({className:r,variant:t,...s},o)=>w.jsx(kg,{ref:o,className:Hs(H1({variant:t}),r),...s}));Xg.displayName=kg.displayName;const W1=_.forwardRef(({className:r,...t},s)=>w.jsx(Tg,{ref:s,className:Hs("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",r),...t}));W1.displayName=Tg.displayName;const Yg=_.forwardRef(({className:r,...t},s)=>w.jsx(Pg,{ref:s,className:Hs("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),"toast-close":"",...t,children:w.jsx(Ig,{className:"h-4 w-4"})}));Yg.displayName=Pg.displayName;const Jg=_.forwardRef(({className:r,...t},s)=>w.jsx(Cg,{ref:s,className:Hs("text-sm font-semibold",r),...t}));Jg.displayName=Cg.displayName;const Zg=_.forwardRef(({className:r,...t},s)=>w.jsx(Rg,{ref:s,className:Hs("text-sm opacity-90",r),...t}));Zg.displayName=Rg.displayName;function q1(){const{toasts:r}=R0();return w.jsxs(V1,{children:[r.map(function({id:t,title:s,description:o,action:a,...u}){return w.jsxs(Xg,{...u,children:[w.jsxs("div",{className:"grid gap-1",children:[s&&w.jsx(Jg,{children:s}),o&&w.jsx(Zg,{children:o})]}),a,w.jsx(Yg,{})]},t)}),w.jsx(Gg,{})]})}var oi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Q1={setTimeout:(r,t)=>setTimeout(r,t),clearTimeout:r=>clearTimeout(r),setInterval:(r,t)=>setInterval(r,t),clearInterval:r=>clearInterval(r)},lr,Hc,Hm,K1=(Hm=class{constructor(){pe(this,lr,Q1);pe(this,Hc,!1)}setTimeoutProvider(r){ee(this,lr,r)}setTimeout(r,t){return R(this,lr).setTimeout(r,t)}clearTimeout(r){R(this,lr).clearTimeout(r)}setInterval(r,t){return R(this,lr).setInterval(r,t)}clearInterval(r){R(this,lr).clearInterval(r)}},lr=new WeakMap,Hc=new WeakMap,Hm),Mr=new K1;function G1(r){setTimeout(r,0)}var Jr=typeof window>"u"||"Deno"in globalThis;function Nt(){}function X1(r,t){return typeof r=="function"?r(t):r}function yc(r){return typeof r=="number"&&r>=0&&r!==1/0}function ey(r,t){return Math.max(r+(t||0)-Date.now(),0)}function yr(r,t){return typeof r=="function"?r(t):r}function Kt(r,t){return typeof r=="function"?r(t):r}function Dp(r,t){const{type:s="all",exact:o,fetchStatus:a,predicate:u,queryKey:d,stale:h}=r;if(d){if(o){if(t.queryHash!==td(d,t.options))return!1}else if(!Go(t.queryKey,d))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof h=="boolean"&&t.isStale()!==h||a&&a!==t.state.fetchStatus||u&&!u(t))}function Mp(r,t){const{exact:s,status:o,predicate:a,mutationKey:u}=r;if(u){if(!t.options.mutationKey)return!1;if(s){if(Ko(t.options.mutationKey)!==Ko(u))return!1}else if(!Go(t.options.mutationKey,u))return!1}return!(o&&t.state.status!==o||a&&!a(t))}function td(r,t){return((t==null?void 0:t.queryKeyHashFn)||Ko)(r)}function Ko(r){return JSON.stringify(r,(t,s)=>wc(s)?Object.keys(s).sort().reduce((o,a)=>(o[a]=s[a],o),{}):s)}function Go(r,t){return r===t?!0:typeof r!=typeof t?!1:r&&t&&typeof r=="object"&&typeof t=="object"?Object.keys(t).every(s=>Go(r[s],t[s])):!1}var Y1=Object.prototype.hasOwnProperty;function ty(r,t,s=0){if(r===t)return r;if(s>500)return t;const o=Fp(r)&&Fp(t);if(!o&&!(wc(r)&&wc(t)))return t;const u=(o?r:Object.keys(r)).length,d=o?t:Object.keys(t),h=d.length,p=o?new Array(h):{};let m=0;for(let y=0;y{Mr.setTimeout(t,r)})}function xc(r,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(r,t):s.structuralSharing!==!1?ty(r,t):t}function Z1(r,t,s=0){const o=[...r,t];return s&&o.length>s?o.slice(1):o}function eE(r,t,s=0){const o=[t,...r];return s&&o.length>s?o.slice(0,-1):o}var nd=Symbol();function ny(r,t){return!r.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!r.queryFn||r.queryFn===nd?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function ry(r,t){return typeof r=="function"?r(...t):!!r}function tE(r,t,s){let o=!1,a;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(a??(a=t()),o||(o=!0,a.aborted?s():a.addEventListener("abort",s,{once:!0})),a)}),r}var Ur,ur,Ns,Wm,nE=(Wm=class extends oi{constructor(){super();pe(this,Ur);pe(this,ur);pe(this,Ns);ee(this,Ns,t=>{if(!Jr&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){R(this,ur)||this.setEventListener(R(this,Ns))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,ur))==null||t.call(this),ee(this,ur,void 0))}setEventListener(t){var s;ee(this,Ns,t),(s=R(this,ur))==null||s.call(this),ee(this,ur,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(t){R(this,Ur)!==t&&(ee(this,Ur,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof R(this,Ur)=="boolean"?R(this,Ur):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ur=new WeakMap,ur=new WeakMap,Ns=new WeakMap,Wm),rd=new nE;function Ec(){let r,t;const s=new Promise((a,u)=>{r=a,t=u});s.status="pending",s.catch(()=>{});function o(a){Object.assign(s,a),delete s.resolve,delete s.reject}return s.resolve=a=>{o({status:"fulfilled",value:a}),r(a)},s.reject=a=>{o({status:"rejected",reason:a}),t(a)},s}var rE=G1;function sE(){let r=[],t=0,s=h=>{h()},o=h=>{h()},a=rE;const u=h=>{t?r.push(h):a(()=>{s(h)})},d=()=>{const h=r;r=[],h.length&&a(()=>{o(()=>{h.forEach(p=>{s(p)})})})};return{batch:h=>{let p;t++;try{p=h()}finally{t--,t||d()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{a=h}}}var dt=sE(),Os,cr,As,qm,oE=(qm=class extends oi{constructor(){super();pe(this,Os,!0);pe(this,cr);pe(this,As);ee(this,As,t=>{if(!Jr&&window.addEventListener){const s=()=>t(!0),o=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}})}onSubscribe(){R(this,cr)||this.setEventListener(R(this,As))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,cr))==null||t.call(this),ee(this,cr,void 0))}setEventListener(t){var s;ee(this,As,t),(s=R(this,cr))==null||s.call(this),ee(this,cr,t(this.setOnline.bind(this)))}setOnline(t){R(this,Os)!==t&&(ee(this,Os,t),this.listeners.forEach(o=>{o(t)}))}isOnline(){return R(this,Os)}},Os=new WeakMap,cr=new WeakMap,As=new WeakMap,qm),$a=new oE;function iE(r){return Math.min(1e3*2**r,3e4)}function sy(r){return(r??"online")==="online"?$a.isOnline():!0}var Sc=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function oy(r){let t=!1,s=0,o;const a=Ec(),u=()=>a.status!=="pending",d=b=>{var x;if(!u()){const S=new Sc(b);k(S),(x=r.onCancel)==null||x.call(r,S)}},h=()=>{t=!0},p=()=>{t=!1},m=()=>rd.isFocused()&&(r.networkMode==="always"||$a.isOnline())&&r.canRun(),y=()=>sy(r.networkMode)&&r.canRun(),v=b=>{u()||(o==null||o(),a.resolve(b))},k=b=>{u()||(o==null||o(),a.reject(b))},L=()=>new Promise(b=>{var x;o=S=>{(u()||m())&&b(S)},(x=r.onPause)==null||x.call(r)}).then(()=>{var b;o=void 0,u()||(b=r.onContinue)==null||b.call(r)}),F=()=>{if(u())return;let b;const x=s===0?r.initialPromise:void 0;try{b=x??r.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(v).catch(S=>{var $;if(u())return;const I=r.retry??(Jr?0:3),P=r.retryDelay??iE,A=typeof P=="function"?P(s,S):P,V=I===!0||typeof I=="number"&&sm()?void 0:L()).then(()=>{t?k(S):F()})})};return{promise:a,status:()=>a.status,cancel:d,continue:()=>(o==null||o(),a),cancelRetry:h,continueRetry:p,canStart:y,start:()=>(y()?F():L().then(F),a)}}var zr,Qm,iy=(Qm=class{constructor(){pe(this,zr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yc(this.gcTime)&&ee(this,zr,Mr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(Jr?1/0:300*1e3))}clearGcTimeout(){R(this,zr)&&(Mr.clearTimeout(R(this,zr)),ee(this,zr,void 0))}},zr=new WeakMap,Qm),Br,Ls,Qt,$r,ot,Zo,Vr,an,An,Km,aE=(Km=class extends iy{constructor(t){super();pe(this,an);pe(this,Br);pe(this,Ls);pe(this,Qt);pe(this,$r);pe(this,ot);pe(this,Zo);pe(this,Vr);ee(this,Vr,!1),ee(this,Zo,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,$r,t.client),ee(this,Qt,R(this,$r).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,Br,Bp(this.options)),this.state=t.state??R(this,Br),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=R(this,ot))==null?void 0:t.promise}setOptions(t){if(this.options={...R(this,Zo),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Bp(this.options);s.data!==void 0&&(this.setState(zp(s.data,s.dataUpdatedAt)),ee(this,Br,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,Qt).remove(this)}setData(t,s){const o=xc(this.state.data,t,this.options);return Pe(this,an,An).call(this,{data:o,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),o}setState(t,s){Pe(this,an,An).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var o,a;const s=(o=R(this,ot))==null?void 0:o.promise;return(a=R(this,ot))==null||a.cancel(t),s?s.then(Nt).catch(Nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(R(this,Br))}isActive(){return this.observers.some(t=>Kt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>yr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ey(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(o=>o.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=R(this,ot))==null||s.continue()}onOnline(){var s;const t=this.observers.find(o=>o.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=R(this,ot))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),R(this,Qt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(R(this,ot)&&(R(this,Vr)?R(this,ot).cancel({revert:!0}):R(this,ot).cancelRetry()),this.scheduleGc()),R(this,Qt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pe(this,an,An).call(this,{type:"invalidate"})}async fetch(t,s){var p,m,y,v,k,L,F,b,x,S,I,P;if(this.state.fetchStatus!=="idle"&&((p=R(this,ot))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(R(this,ot))return R(this,ot).continueRetry(),R(this,ot).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(V=>V.options.queryFn);A&&this.setOptions(A.options)}const o=new AbortController,a=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(ee(this,Vr,!0),o.signal)})},u=()=>{const A=ny(this.options,s),$=(()=>{const G={client:R(this,$r),queryKey:this.queryKey,meta:this.meta};return a(G),G})();return ee(this,Vr,!1),this.options.persister?this.options.persister(A,$,this):A($)},h=(()=>{const A={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:R(this,$r),state:this.state,fetchFn:u};return a(A),A})();(m=this.options.behavior)==null||m.onFetch(h,this),ee(this,Ls,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=h.fetchOptions)==null?void 0:y.meta))&&Pe(this,an,An).call(this,{type:"fetch",meta:(v=h.fetchOptions)==null?void 0:v.meta}),ee(this,ot,oy({initialPromise:s==null?void 0:s.initialPromise,fn:h.fetchFn,onCancel:A=>{A instanceof Sc&&A.revert&&this.setState({...R(this,Ls),fetchStatus:"idle"}),o.abort()},onFail:(A,V)=>{Pe(this,an,An).call(this,{type:"failed",failureCount:A,error:V})},onPause:()=>{Pe(this,an,An).call(this,{type:"pause"})},onContinue:()=>{Pe(this,an,An).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const A=await R(this,ot).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(L=(k=R(this,Qt).config).onSuccess)==null||L.call(k,A,this),(b=(F=R(this,Qt).config).onSettled)==null||b.call(F,A,this.state.error,this),A}catch(A){if(A instanceof Sc){if(A.silent)return R(this,ot).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw Pe(this,an,An).call(this,{type:"error",error:A}),(S=(x=R(this,Qt).config).onError)==null||S.call(x,A,this),(P=(I=R(this,Qt).config).onSettled)==null||P.call(I,this.state.data,A,this),A}finally{this.scheduleGc()}}},Br=new WeakMap,Ls=new WeakMap,Qt=new WeakMap,$r=new WeakMap,ot=new WeakMap,Zo=new WeakMap,Vr=new WeakMap,an=new WeakSet,An=function(t){const s=o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...ay(o.data,this.options),fetchMeta:t.meta??null};case"success":const a={...o,...zp(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,Ls,t.manual?a:void 0),a;case"error":const u=t.error;return{...o,error:u,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}};this.state=s(this.state),dt.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),R(this,Qt).notify({query:this,type:"updated",action:t})})},Km);function ay(r,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sy(t.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function zp(r,t){return{data:r,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bp(r){const t=typeof r.initialData=="function"?r.initialData():r.initialData,s=t!==void 0,o=s?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Pt,Ne,ei,St,Hr,Is,In,dr,ti,js,Ds,Wr,qr,fr,Ms,je,zo,_c,bc,kc,Cc,Rc,Tc,Pc,ly,Gm,lE=(Gm=class extends oi{constructor(t,s){super();pe(this,je);pe(this,Pt);pe(this,Ne);pe(this,ei);pe(this,St);pe(this,Hr);pe(this,Is);pe(this,In);pe(this,dr);pe(this,ti);pe(this,js);pe(this,Ds);pe(this,Wr);pe(this,qr);pe(this,fr);pe(this,Ms,new Set);this.options=s,ee(this,Pt,t),ee(this,dr,null),ee(this,In,Ec()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Ne).addObserver(this),$p(R(this,Ne),this.options)?Pe(this,je,zo).call(this):this.updateResult(),Pe(this,je,Cc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nc(R(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nc(R(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pe(this,je,Rc).call(this),Pe(this,je,Tc).call(this),R(this,Ne).removeObserver(this)}setOptions(t){const s=this.options,o=R(this,Ne);if(this.options=R(this,Pt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Kt(this.options.enabled,R(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pe(this,je,Pc).call(this),R(this,Ne).setOptions(this.options),s._defaulted&&!vc(this.options,s)&&R(this,Pt).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Ne),observer:this});const a=this.hasListeners();a&&Vp(R(this,Ne),o,this.options,s)&&Pe(this,je,zo).call(this),this.updateResult(),a&&(R(this,Ne)!==o||Kt(this.options.enabled,R(this,Ne))!==Kt(s.enabled,R(this,Ne))||yr(this.options.staleTime,R(this,Ne))!==yr(s.staleTime,R(this,Ne)))&&Pe(this,je,_c).call(this);const u=Pe(this,je,bc).call(this);a&&(R(this,Ne)!==o||Kt(this.options.enabled,R(this,Ne))!==Kt(s.enabled,R(this,Ne))||u!==R(this,fr))&&Pe(this,je,kc).call(this,u)}getOptimisticResult(t){const s=R(this,Pt).getQueryCache().build(R(this,Pt),t),o=this.createResult(s,t);return cE(this,o)&&(ee(this,St,o),ee(this,Is,this.options),ee(this,Hr,R(this,Ne).state)),o}getCurrentResult(){return R(this,St)}trackResult(t,s){return new Proxy(t,{get:(o,a)=>(this.trackProp(a),s==null||s(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&R(this,In).status==="pending"&&R(this,In).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,a))})}trackProp(t){R(this,Ms).add(t)}getCurrentQuery(){return R(this,Ne)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=R(this,Pt).defaultQueryOptions(t),o=R(this,Pt).getQueryCache().build(R(this,Pt),s);return o.fetch().then(()=>this.createResult(o,s))}fetch(t){return Pe(this,je,zo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,St)))}createResult(t,s){var ie;const o=R(this,Ne),a=this.options,u=R(this,St),d=R(this,Hr),h=R(this,Is),m=t!==o?t.state:R(this,ei),{state:y}=t;let v={...y},k=!1,L;if(s._optimisticResults){const ue=this.hasListeners(),Ee=!ue&&$p(t,s),Te=ue&&Vp(t,o,s,a);(Ee||Te)&&(v={...v,...ay(y.data,t.options)}),s._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:F,errorUpdatedAt:b,status:x}=v;L=v.data;let S=!1;if(s.placeholderData!==void 0&&L===void 0&&x==="pending"){let ue;u!=null&&u.isPlaceholderData&&s.placeholderData===(h==null?void 0:h.placeholderData)?(ue=u.data,S=!0):ue=typeof s.placeholderData=="function"?s.placeholderData((ie=R(this,Ds))==null?void 0:ie.state.data,R(this,Ds)):s.placeholderData,ue!==void 0&&(x="success",L=xc(u==null?void 0:u.data,ue,s),k=!0)}if(s.select&&L!==void 0&&!S)if(u&&L===(d==null?void 0:d.data)&&s.select===R(this,ti))L=R(this,js);else try{ee(this,ti,s.select),L=s.select(L),L=xc(u==null?void 0:u.data,L,s),ee(this,js,L),ee(this,dr,null)}catch(ue){ee(this,dr,ue)}R(this,dr)&&(F=R(this,dr),L=R(this,js),b=Date.now(),x="error");const I=v.fetchStatus==="fetching",P=x==="pending",A=x==="error",V=P&&I,$=L!==void 0,B={status:x,fetchStatus:v.fetchStatus,isPending:P,isSuccess:x==="success",isError:A,isInitialLoading:V,isLoading:V,data:L,dataUpdatedAt:v.dataUpdatedAt,error:F,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:I,isRefetching:I&&!P,isLoadingError:A&&!$,isPaused:v.fetchStatus==="paused",isPlaceholderData:k,isRefetchError:A&&$,isStale:sd(t,s),refetch:this.refetch,promise:R(this,In),isEnabled:Kt(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const ue=B.data!==void 0,Ee=B.status==="error"&&!ue,Te=_e=>{Ee?_e.reject(B.error):ue&&_e.resolve(B.data)},xe=()=>{const _e=ee(this,In,B.promise=Ec());Te(_e)},J=R(this,In);switch(J.status){case"pending":t.queryHash===o.queryHash&&Te(J);break;case"fulfilled":(Ee||B.data!==J.value)&&xe();break;case"rejected":(!Ee||B.error!==J.reason)&&xe();break}}return B}updateResult(){const t=R(this,St),s=this.createResult(R(this,Ne),this.options);if(ee(this,Hr,R(this,Ne).state),ee(this,Is,this.options),R(this,Hr).data!==void 0&&ee(this,Ds,R(this,Ne)),vc(s,t))return;ee(this,St,s);const o=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,u=typeof a=="function"?a():a;if(u==="all"||!u&&!R(this,Ms).size)return!0;const d=new Set(u??R(this,Ms));return this.options.throwOnError&&d.add("error"),Object.keys(R(this,St)).some(h=>{const p=h;return R(this,St)[p]!==t[p]&&d.has(p)})};Pe(this,je,ly).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pe(this,je,Cc).call(this)}},Pt=new WeakMap,Ne=new WeakMap,ei=new WeakMap,St=new WeakMap,Hr=new WeakMap,Is=new WeakMap,In=new WeakMap,dr=new WeakMap,ti=new WeakMap,js=new WeakMap,Ds=new WeakMap,Wr=new WeakMap,qr=new WeakMap,fr=new WeakMap,Ms=new WeakMap,je=new WeakSet,zo=function(t){Pe(this,je,Pc).call(this);let s=R(this,Ne).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(Nt)),s},_c=function(){Pe(this,je,Rc).call(this);const t=yr(this.options.staleTime,R(this,Ne));if(Jr||R(this,St).isStale||!yc(t))return;const o=ey(R(this,St).dataUpdatedAt,t)+1;ee(this,Wr,Mr.setTimeout(()=>{R(this,St).isStale||this.updateResult()},o))},bc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Ne)):this.options.refetchInterval)??!1},kc=function(t){Pe(this,je,Tc).call(this),ee(this,fr,t),!(Jr||Kt(this.options.enabled,R(this,Ne))===!1||!yc(R(this,fr))||R(this,fr)===0)&&ee(this,qr,Mr.setInterval(()=>{(this.options.refetchIntervalInBackground||rd.isFocused())&&Pe(this,je,zo).call(this)},R(this,fr)))},Cc=function(){Pe(this,je,_c).call(this),Pe(this,je,kc).call(this,Pe(this,je,bc).call(this))},Rc=function(){R(this,Wr)&&(Mr.clearTimeout(R(this,Wr)),ee(this,Wr,void 0))},Tc=function(){R(this,qr)&&(Mr.clearInterval(R(this,qr)),ee(this,qr,void 0))},Pc=function(){const t=R(this,Pt).getQueryCache().build(R(this,Pt),this.options);if(t===R(this,Ne))return;const s=R(this,Ne);ee(this,Ne,t),ee(this,ei,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},ly=function(t){dt.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(R(this,St))}),R(this,Pt).getQueryCache().notify({query:R(this,Ne),type:"observerResultsUpdated"})})},Gm);function uE(r,t){return Kt(t.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&t.retryOnMount===!1)}function $p(r,t){return uE(r,t)||r.state.data!==void 0&&Nc(r,t,t.refetchOnMount)}function Nc(r,t,s){if(Kt(t.enabled,r)!==!1&&yr(t.staleTime,r)!=="static"){const o=typeof s=="function"?s(r):s;return o==="always"||o!==!1&&sd(r,t)}return!1}function Vp(r,t,s,o){return(r!==t||Kt(o.enabled,r)===!1)&&(!s.suspense||r.state.status!=="error")&&sd(r,s)}function sd(r,t){return Kt(t.enabled,r)!==!1&&r.isStaleByTime(yr(t.staleTime,r))}function cE(r,t){return!vc(r.getCurrentResult(),t)}function Hp(r){return{onFetch:(t,s)=>{var y,v,k,L,F;const o=t.options,a=(k=(v=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:v.fetchMore)==null?void 0:k.direction,u=((L=t.state.data)==null?void 0:L.pages)||[],d=((F=t.state.data)==null?void 0:F.pageParams)||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let b=!1;const x=P=>{tE(P,()=>t.signal,()=>b=!0)},S=ny(t.options,t.fetchOptions),I=async(P,A,V)=>{if(b)return Promise.reject();if(A==null&&P.pages.length)return Promise.resolve(P);const G=(()=>{const Ee={client:t.client,queryKey:t.queryKey,pageParam:A,direction:V?"backward":"forward",meta:t.options.meta};return x(Ee),Ee})(),B=await S(G),{maxPages:ie}=t.options,ue=V?eE:Z1;return{pages:ue(P.pages,B,ie),pageParams:ue(P.pageParams,A,ie)}};if(a&&u.length){const P=a==="backward",A=P?dE:Wp,V={pages:u,pageParams:d},$=A(o,V);h=await I(V,$,P)}else{const P=r??u.length;do{const A=p===0?d[0]??o.initialPageParam:Wp(o,h);if(p>0&&A==null)break;h=await I(h,A),p++}while(p{var b,x;return(x=(b=t.options).persister)==null?void 0:x.call(b,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=m}}}function Wp(r,{pages:t,pageParams:s}){const o=t.length-1;return t.length>0?r.getNextPageParam(t[o],t,s[o],s):void 0}function dE(r,{pages:t,pageParams:s}){var o;return t.length>0?(o=r.getPreviousPageParam)==null?void 0:o.call(r,t[0],t,s[0],s):void 0}var ni,gn,vt,Qr,yn,ar,Xm,fE=(Xm=class extends iy{constructor(t){super();pe(this,yn);pe(this,ni);pe(this,gn);pe(this,vt);pe(this,Qr);ee(this,ni,t.client),this.mutationId=t.mutationId,ee(this,vt,t.mutationCache),ee(this,gn,[]),this.state=t.state||hE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){R(this,gn).includes(t)||(R(this,gn).push(t),this.clearGcTimeout(),R(this,vt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,gn,R(this,gn).filter(s=>s!==t)),this.scheduleGc(),R(this,vt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){R(this,gn).length||(this.state.status==="pending"?this.scheduleGc():R(this,vt).remove(this))}continue(){var t;return((t=R(this,Qr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var d,h,p,m,y,v,k,L,F,b,x,S,I,P,A,V,$,G;const s=()=>{Pe(this,yn,ar).call(this,{type:"continue"})},o={client:R(this,ni),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Qr,oy({fn:()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),onFail:(B,ie)=>{Pe(this,yn,ar).call(this,{type:"failed",failureCount:B,error:ie})},onPause:()=>{Pe(this,yn,ar).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,vt).canRun(this)}));const a=this.state.status==="pending",u=!R(this,Qr).canStart();try{if(a)s();else{Pe(this,yn,ar).call(this,{type:"pending",variables:t,isPaused:u}),R(this,vt).config.onMutate&&await R(this,vt).config.onMutate(t,this,o);const ie=await((h=(d=this.options).onMutate)==null?void 0:h.call(d,t,o));ie!==this.state.context&&Pe(this,yn,ar).call(this,{type:"pending",context:ie,variables:t,isPaused:u})}const B=await R(this,Qr).start();return await((m=(p=R(this,vt).config).onSuccess)==null?void 0:m.call(p,B,t,this.state.context,this,o)),await((v=(y=this.options).onSuccess)==null?void 0:v.call(y,B,t,this.state.context,o)),await((L=(k=R(this,vt).config).onSettled)==null?void 0:L.call(k,B,null,this.state.variables,this.state.context,this,o)),await((b=(F=this.options).onSettled)==null?void 0:b.call(F,B,null,t,this.state.context,o)),Pe(this,yn,ar).call(this,{type:"success",data:B}),B}catch(B){try{await((S=(x=R(this,vt).config).onError)==null?void 0:S.call(x,B,t,this.state.context,this,o))}catch(ie){Promise.reject(ie)}try{await((P=(I=this.options).onError)==null?void 0:P.call(I,B,t,this.state.context,o))}catch(ie){Promise.reject(ie)}try{await((V=(A=R(this,vt).config).onSettled)==null?void 0:V.call(A,void 0,B,this.state.variables,this.state.context,this,o))}catch(ie){Promise.reject(ie)}try{await((G=($=this.options).onSettled)==null?void 0:G.call($,void 0,B,t,this.state.context,o))}catch(ie){Promise.reject(ie)}throw Pe(this,yn,ar).call(this,{type:"error",error:B}),B}finally{R(this,vt).runNext(this)}}},ni=new WeakMap,gn=new WeakMap,vt=new WeakMap,Qr=new WeakMap,yn=new WeakSet,ar=function(t){const s=o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),dt.batch(()=>{R(this,gn).forEach(o=>{o.onMutationUpdate(t)}),R(this,vt).notify({mutation:this,type:"updated",action:t})})},Xm);function hE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jn,ln,ri,Ym,pE=(Ym=class extends oi{constructor(t={}){super();pe(this,jn);pe(this,ln);pe(this,ri);this.config=t,ee(this,jn,new Set),ee(this,ln,new Map),ee(this,ri,0)}build(t,s,o){const a=new fE({client:t,mutationCache:this,mutationId:++xa(this,ri)._,options:t.defaultMutationOptions(s),state:o});return this.add(a),a}add(t){R(this,jn).add(t);const s=Ca(t);if(typeof s=="string"){const o=R(this,ln).get(s);o?o.push(t):R(this,ln).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(R(this,jn).delete(t)){const s=Ca(t);if(typeof s=="string"){const o=R(this,ln).get(s);if(o)if(o.length>1){const a=o.indexOf(t);a!==-1&&o.splice(a,1)}else o[0]===t&&R(this,ln).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=Ca(t);if(typeof s=="string"){const o=R(this,ln).get(s),a=o==null?void 0:o.find(u=>u.state.status==="pending");return!a||a===t}else return!0}runNext(t){var o;const s=Ca(t);if(typeof s=="string"){const a=(o=R(this,ln).get(s))==null?void 0:o.find(u=>u!==t&&u.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dt.batch(()=>{R(this,jn).forEach(t=>{this.notify({type:"removed",mutation:t})}),R(this,jn).clear(),R(this,ln).clear()})}getAll(){return Array.from(R(this,jn))}find(t){const s={exact:!0,...t};return this.getAll().find(o=>Mp(s,o))}findAll(t={}){return this.getAll().filter(s=>Mp(t,s))}notify(t){dt.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return dt.batch(()=>Promise.all(t.map(s=>s.continue().catch(Nt))))}},jn=new WeakMap,ln=new WeakMap,ri=new WeakMap,Ym);function Ca(r){var t;return(t=r.options.scope)==null?void 0:t.id}var vn,Jm,mE=(Jm=class extends oi{constructor(t={}){super();pe(this,vn);this.config=t,ee(this,vn,new Map)}build(t,s,o){const a=s.queryKey,u=s.queryHash??td(a,s);let d=this.get(u);return d||(d=new aE({client:t,queryKey:a,queryHash:u,options:t.defaultQueryOptions(s),state:o,defaultOptions:t.getQueryDefaults(a)}),this.add(d)),d}add(t){R(this,vn).has(t.queryHash)||(R(this,vn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=R(this,vn).get(t.queryHash);s&&(t.destroy(),s===t&&R(this,vn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return R(this,vn).get(t)}getAll(){return[...R(this,vn).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(o=>Dp(s,o))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(o=>Dp(t,o)):s}notify(t){dt.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},vn=new WeakMap,Jm),We,hr,pr,Fs,Us,mr,zs,Bs,Zm,gE=(Zm=class{constructor(r={}){pe(this,We);pe(this,hr);pe(this,pr);pe(this,Fs);pe(this,Us);pe(this,mr);pe(this,zs);pe(this,Bs);ee(this,We,r.queryCache||new mE),ee(this,hr,r.mutationCache||new pE),ee(this,pr,r.defaultOptions||{}),ee(this,Fs,new Map),ee(this,Us,new Map),ee(this,mr,0)}mount(){xa(this,mr)._++,R(this,mr)===1&&(ee(this,zs,rd.subscribe(async r=>{r&&(await this.resumePausedMutations(),R(this,We).onFocus())})),ee(this,Bs,$a.subscribe(async r=>{r&&(await this.resumePausedMutations(),R(this,We).onOnline())})))}unmount(){var r,t;xa(this,mr)._--,R(this,mr)===0&&((r=R(this,zs))==null||r.call(this),ee(this,zs,void 0),(t=R(this,Bs))==null||t.call(this),ee(this,Bs,void 0))}isFetching(r){return R(this,We).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return R(this,hr).findAll({...r,status:"pending"}).length}getQueryData(r){var s;const t=this.defaultQueryOptions({queryKey:r});return(s=R(this,We).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(r){const t=this.defaultQueryOptions(r),s=R(this,We).build(this,t),o=s.state.data;return o===void 0?this.fetchQuery(r):(r.revalidateIfStale&&s.isStaleByTime(yr(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(r){return R(this,We).findAll(r).map(({queryKey:t,state:s})=>{const o=s.data;return[t,o]})}setQueryData(r,t,s){const o=this.defaultQueryOptions({queryKey:r}),a=R(this,We).get(o.queryHash),u=a==null?void 0:a.state.data,d=X1(t,u);if(d!==void 0)return R(this,We).build(this,o).setData(d,{...s,manual:!0})}setQueriesData(r,t,s){return dt.batch(()=>R(this,We).findAll(r).map(({queryKey:o})=>[o,this.setQueryData(o,t,s)]))}getQueryState(r){var s;const t=this.defaultQueryOptions({queryKey:r});return(s=R(this,We).get(t.queryHash))==null?void 0:s.state}removeQueries(r){const t=R(this,We);dt.batch(()=>{t.findAll(r).forEach(s=>{t.remove(s)})})}resetQueries(r,t){const s=R(this,We);return dt.batch(()=>(s.findAll(r).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...r},t)))}cancelQueries(r,t={}){const s={revert:!0,...t},o=dt.batch(()=>R(this,We).findAll(r).map(a=>a.cancel(s)));return Promise.all(o).then(Nt).catch(Nt)}invalidateQueries(r,t={}){return dt.batch(()=>(R(this,We).findAll(r).forEach(s=>{s.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},t)))}refetchQueries(r,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},o=dt.batch(()=>R(this,We).findAll(r).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let u=a.fetch(void 0,s);return s.throwOnError||(u=u.catch(Nt)),a.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Nt)}fetchQuery(r){const t=this.defaultQueryOptions(r);t.retry===void 0&&(t.retry=!1);const s=R(this,We).build(this,t);return s.isStaleByTime(yr(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(Nt).catch(Nt)}fetchInfiniteQuery(r){return r.behavior=Hp(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(Nt).catch(Nt)}ensureInfiniteQueryData(r){return r.behavior=Hp(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return $a.isOnline()?R(this,hr).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,We)}getMutationCache(){return R(this,hr)}getDefaultOptions(){return R(this,pr)}setDefaultOptions(r){ee(this,pr,r)}setQueryDefaults(r,t){R(this,Fs).set(Ko(r),{queryKey:r,defaultOptions:t})}getQueryDefaults(r){const t=[...R(this,Fs).values()],s={};return t.forEach(o=>{Go(r,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(r,t){R(this,Us).set(Ko(r),{mutationKey:r,defaultOptions:t})}getMutationDefaults(r){const t=[...R(this,Us).values()],s={};return t.forEach(o=>{Go(r,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(r){if(r._defaulted)return r;const t={...R(this,pr).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return t.queryHash||(t.queryHash=td(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===nd&&(t.enabled=!1),t}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...R(this,pr).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){R(this,We).clear(),R(this,hr).clear()}},We=new WeakMap,hr=new WeakMap,pr=new WeakMap,Fs=new WeakMap,Us=new WeakMap,mr=new WeakMap,zs=new WeakMap,Bs=new WeakMap,Zm),uy=_.createContext(void 0),yE=r=>{const t=_.useContext(uy);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vE=({client:r,children:t})=>(_.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),w.jsx(uy.Provider,{value:r,children:t})),cy=_.createContext(!1),wE=()=>_.useContext(cy);cy.Provider;function xE(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var EE=_.createContext(xE()),SE=()=>_.useContext(EE),_E=(r,t,s)=>{const o=s!=null&&s.state.error&&typeof r.throwOnError=="function"?ry(r.throwOnError,[s.state.error,s]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||o)&&(t.isReset()||(r.retryOnMount=!1))},bE=r=>{_.useEffect(()=>{r.clearReset()},[r])},kE=({result:r,errorResetBoundary:t,throwOnError:s,query:o,suspense:a})=>r.isError&&!t.isReset()&&!r.isFetching&&o&&(a&&r.data===void 0||ry(s,[r.error,o])),CE=r=>{if(r.suspense){const s=a=>a==="static"?a:Math.max(a??1e3,1e3),o=r.staleTime;r.staleTime=typeof o=="function"?(...a)=>s(o(...a)):s(o),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},RE=(r,t)=>r.isLoading&&r.isFetching&&!t,TE=(r,t)=>(r==null?void 0:r.suspense)&&t.isPending,qp=(r,t,s)=>t.fetchOptimistic(r).catch(()=>{s.clearReset()});function PE(r,t,s){var k,L,F,b;const o=wE(),a=SE(),u=yE(),d=u.defaultQueryOptions(r);(L=(k=u.getDefaultOptions().queries)==null?void 0:k._experimental_beforeQuery)==null||L.call(k,d);const h=u.getQueryCache().get(d.queryHash);d._optimisticResults=o?"isRestoring":"optimistic",CE(d),_E(d,a,h),bE(a);const p=!u.getQueryCache().get(d.queryHash),[m]=_.useState(()=>new t(u,d)),y=m.getOptimisticResult(d),v=!o&&r.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(x=>{const S=v?m.subscribe(dt.batchCalls(x)):Nt;return m.updateResult(),S},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),_.useEffect(()=>{m.setOptions(d)},[d,m]),TE(d,y))throw qp(d,m,a);if(kE({result:y,errorResetBoundary:a,throwOnError:d.throwOnError,query:h,suspense:d.suspense}))throw y.error;if((b=(F=u.getDefaultOptions().queries)==null?void 0:F._experimental_afterQuery)==null||b.call(F,d,y),d.experimental_prefetchInRender&&!Jr&&RE(y,o)){const x=p?qp(d,m,a):h==null?void 0:h.promise;x==null||x.catch(Nt).finally(()=>{m.updateResult()})}return d.notifyOnChangeProps?y:m.trackResult(y)}function NE(r,t){return PE(r,lE)}const OE=new gE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});/** * @remix-run/router v1.23.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Xo(){return Xo=Object.assign?Object.assign.bind():function(r){for(var t=1;t"u")throw new Error(t)}function od(r,t){if(!r){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function LE(){return Math.random().toString(36).substr(2,8)}function Kp(r,t){return{usr:r.state,key:r.key,idx:t}}function Oc(r,t,s,o){return s===void 0&&(s=null),Xo({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof t=="string"?Ws(t):t,{state:s,key:t&&t.key||o||LE()})}function Va(r){let{pathname:t="/",search:s="",hash:o=""}=r;return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function Ws(r){let t={};if(r){let s=r.indexOf("#");s>=0&&(t.hash=r.substr(s),r=r.substr(0,s));let o=r.indexOf("?");o>=0&&(t.search=r.substr(o),r=r.substr(0,o)),r&&(t.pathname=r)}return t}function IE(r,t,s,o){o===void 0&&(o={});let{window:a=document.defaultView,v5Compat:u=!1}=o,d=a.history,h=gr.Pop,p=null,m=y();m==null&&(m=0,d.replaceState(Xo({},d.state,{idx:m}),""));function y(){return(d.state||{idx:null}).idx}function v(){h=gr.Pop;let x=y(),S=x==null?null:x-m;m=x,p&&p({action:h,location:b.location,delta:S})}function k(x,S){h=gr.Push;let I=Oc(b.location,x,S);m=y()+1;let P=Kp(I,m),A=b.createHref(I);try{d.pushState(P,"",A)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;a.location.assign(A)}u&&p&&p({action:h,location:b.location,delta:1})}function L(x,S){h=gr.Replace;let I=Oc(b.location,x,S);m=y();let P=Kp(I,m),A=b.createHref(I);d.replaceState(P,"",A),u&&p&&p({action:h,location:b.location,delta:0})}function F(x){let S=a.location.origin!=="null"?a.location.origin:a.location.href,I=typeof x=="string"?x:Va(x);return I=I.replace(/ $/,"%20"),Ye(S,"No window.location.(origin|href) available to create URL for href: "+I),new URL(I,S)}let b={get action(){return h},get location(){return r(a,d)},listen(x){if(p)throw new Error("A history only accepts one active listener");return a.addEventListener(Qp,v),p=x,()=>{a.removeEventListener(Qp,v),p=null}},createHref(x){return t(a,x)},createURL:F,encodeLocation(x){let S=F(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:k,replace:L,go(x){return d.go(x)}};return b}var Gp;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Gp||(Gp={}));function jE(r,t,s){return s===void 0&&(s="/"),DE(r,t,s)}function DE(r,t,s,o){let a=typeof t=="string"?Ws(t):t,u=id(a.pathname||"/",s);if(u==null)return null;let d=dy(r);ME(d);let h=null,p=GE(u);for(let m=0;h==null&&m{let p={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};p.relativePath.startsWith("/")&&(Ye(p.relativePath.startsWith(o),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(o.length));let m=vr([o,p.relativePath]),y=s.concat(p);u.children&&u.children.length>0&&(Ye(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+m+'".')),dy(u.children,t,y,m)),!(u.path==null&&!u.index)&&t.push({path:m,score:HE(m,u.index),routesMeta:y})};return r.forEach((u,d)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))a(u,d);else for(let p of fy(u.path))a(u,d,p)}),t}function fy(r){let t=r.split("/");if(t.length===0)return[];let[s,...o]=t,a=s.endsWith("?"),u=s.replace(/\?$/,"");if(o.length===0)return a?[u,""]:[u];let d=fy(o.join("/")),h=[];return h.push(...d.map(p=>p===""?u:[u,p].join("/"))),a&&h.push(...d),h.map(p=>r.startsWith("/")&&p===""?"/":p)}function ME(r){r.sort((t,s)=>t.score!==s.score?s.score-t.score:WE(t.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}const FE=/^:[\w-]+$/,UE=3,zE=2,BE=1,$E=10,VE=-2,Xp=r=>r==="*";function HE(r,t){let s=r.split("/"),o=s.length;return s.some(Xp)&&(o+=VE),t&&(o+=zE),s.filter(a=>!Xp(a)).reduce((a,u)=>a+(FE.test(u)?UE:u===""?BE:$E),o)}function WE(r,t){return r.length===t.length&&r.slice(0,-1).every((o,a)=>o===t[a])?r[r.length-1]-t[t.length-1]:0}function qE(r,t,s){let{routesMeta:o}=r,a={},u="/",d=[];for(let h=0;h{let{paramName:k,isOptional:L}=y;if(k==="*"){let b=h[v]||"";d=u.slice(0,u.length-b.length).replace(/(.)\/+$/,"$1")}const F=h[v];return L&&!F?m[k]=void 0:m[k]=(F||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:d,pattern:r}}function KE(r,t,s){t===void 0&&(t=!1),s===void 0&&(s=!0),od(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],a="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,p)=>(o.push({paramName:h,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),a+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?a+="\\/*$":r!==""&&r!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),o]}function GE(r){try{return r.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return od(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),r}}function id(r,t){if(t==="/")return r;if(!r.toLowerCase().startsWith(t.toLowerCase()))return null;let s=t.endsWith("/")?t.length-1:t.length,o=r.charAt(s);return o&&o!=="/"?null:r.slice(s)||"/"}const XE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,YE=r=>XE.test(r);function JE(r,t){t===void 0&&(t="/");let{pathname:s,search:o="",hash:a=""}=typeof r=="string"?Ws(r):r,u;if(s)if(YE(s))u=s;else{if(s.includes("//")){let d=s;s=my(s),od(!1,"Pathnames cannot have embedded double slashes - normalizing "+(d+" -> "+s))}s.startsWith("/")?u=Yp(s.substring(1),"/"):u=Yp(s,t)}else u=t;return{pathname:u,search:tS(o),hash:nS(a)}}function Yp(r,t){let s=t.replace(/\/+$/,"").split("/");return r.split("/").forEach(a=>{a===".."?s.length>1&&s.pop():a!=="."&&s.push(a)}),s.length>1?s.join("/"):"/"}function Ju(r,t,s,o){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function ZE(r){return r.filter((t,s)=>s===0||t.route.path&&t.route.path.length>0)}function hy(r,t){let s=ZE(r);return t?s.map((o,a)=>a===s.length-1?o.pathname:o.pathnameBase):s.map(o=>o.pathnameBase)}function py(r,t,s,o){o===void 0&&(o=!1);let a;typeof r=="string"?a=Ws(r):(a=Xo({},r),Ye(!a.pathname||!a.pathname.includes("?"),Ju("?","pathname","search",a)),Ye(!a.pathname||!a.pathname.includes("#"),Ju("#","pathname","hash",a)),Ye(!a.search||!a.search.includes("#"),Ju("#","search","hash",a)));let u=r===""||a.pathname==="",d=u?"/":a.pathname,h;if(d==null)h=s;else{let v=t.length-1;if(!o&&d.startsWith("..")){let k=d.split("/");for(;k[0]==="..";)k.shift(),v-=1;a.pathname=k.join("/")}h=v>=0?t[v]:"/"}let p=JE(a,h),m=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&s.endsWith("/");return!p.pathname.endsWith("/")&&(m||y)&&(p.pathname+="/"),p}const my=r=>r.replace(/\/\/+/g,"/"),vr=r=>my(r.join("/")),eS=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),tS=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,nS=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function rS(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const gy=["post","put","patch","delete"];new Set(gy);const sS=["get",...gy];new Set(sS);/** * React Router v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Yo(){return Yo=Object.assign?Object.assign.bind():function(r){for(var t=1;t{h.current=!0}),_.useCallback(function(m,y){if(y===void 0&&(y={}),!h.current)return;if(typeof m=="number"){o.go(m);return}let v=py(m,JSON.parse(d),u,y.relative==="path");r==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:vr([t,v.pathname])),(y.replace?o.replace:o.push)(v,y.state,y)},[t,o,d,u,r])}function wy(r,t){let{relative:s}=t===void 0?{}:t,{future:o}=_.useContext(ns),{matches:a}=_.useContext(rs),{pathname:u}=qs(),d=JSON.stringify(hy(a,o.v7_relativeSplatPath));return _.useMemo(()=>py(r,JSON.parse(d),u,s==="path"),[r,d,u,s])}function cS(r,t){return dS(r,t)}function dS(r,t,s,o){ai()||Ye(!1);let{navigator:a}=_.useContext(ns),{matches:u}=_.useContext(rs),d=u[u.length-1],h=d?d.params:{};d&&d.pathname;let p=d?d.pathnameBase:"/";d&&d.route;let m=qs(),y;if(t){var v;let x=typeof t=="string"?Ws(t):t;p==="/"||(v=x.pathname)!=null&&v.startsWith(p)||Ye(!1),y=x}else y=m;let k=y.pathname||"/",L=k;if(p!=="/"){let x=p.replace(/^\//,"").split("/");L="/"+k.replace(/^\//,"").split("/").slice(x.length).join("/")}let F=jE(r,{pathname:L}),b=gS(F&&F.map(x=>Object.assign({},x,{params:Object.assign({},h,x.params),pathname:vr([p,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?p:vr([p,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),u,s,o);return t&&b?_.createElement(ii.Provider,{value:{location:Yo({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:gr.Pop}},b):b}function fS(){let r=xS(),t=rS(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),s=r instanceof Error?r.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),s?_.createElement("pre",{style:a},s):null,null)}const hS=_.createElement(fS,null);class pS extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){console.error("React Router caught the following error during render",t,s)}render(){return this.state.error!==void 0?_.createElement(rs.Provider,{value:this.props.routeContext},_.createElement(yy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mS(r){let{routeContext:t,match:s,children:o}=r,a=_.useContext(ad);return a&&a.static&&a.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=s.route.id),_.createElement(rs.Provider,{value:t},o)}function gS(r,t,s,o){var a;if(t===void 0&&(t=[]),s===void 0&&(s=null),o===void 0&&(o=null),r==null){var u;if(!s)return null;if(s.errors)r=s.matches;else if((u=o)!=null&&u.v7_partialHydration&&t.length===0&&!s.initialized&&s.matches.length>0)r=s.matches;else return null}let d=r,h=(a=s)==null?void 0:a.errors;if(h!=null){let y=d.findIndex(v=>v.route.id&&(h==null?void 0:h[v.route.id])!==void 0);y>=0||Ye(!1),d=d.slice(0,Math.min(d.length,y+1))}let p=!1,m=-1;if(s&&o&&o.v7_partialHydration)for(let y=0;y=0?d=d.slice(0,m+1):d=[d[0]];break}}}return d.reduceRight((y,v,k)=>{let L,F=!1,b=null,x=null;s&&(L=h&&v.route.id?h[v.route.id]:void 0,b=v.route.errorElement||hS,p&&(m<0&&k===0?(SS("route-fallback"),F=!0,x=null):m===k&&(F=!0,x=v.route.hydrateFallbackElement||null)));let S=t.concat(d.slice(0,k+1)),I=()=>{let P;return L?P=b:F?P=x:v.route.Component?P=_.createElement(v.route.Component,null):v.route.element?P=v.route.element:P=y,_.createElement(mS,{match:v,routeContext:{outlet:y,matches:S,isDataRoute:s!=null},children:P})};return s&&(v.route.ErrorBoundary||v.route.errorElement||k===0)?_.createElement(pS,{location:s.location,revalidation:s.revalidation,component:b,error:L,children:I(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):I()},null)}var xy=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(xy||{}),Ey=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Ey||{});function yS(r){let t=_.useContext(ad);return t||Ye(!1),t}function vS(r){let t=_.useContext(oS);return t||Ye(!1),t}function wS(r){let t=_.useContext(rs);return t||Ye(!1),t}function Sy(r){let t=wS(),s=t.matches[t.matches.length-1];return s.route.id||Ye(!1),s.route.id}function xS(){var r;let t=_.useContext(yy),s=vS(),o=Sy();return t!==void 0?t:(r=s.errors)==null?void 0:r[o]}function ES(){let{router:r}=yS(xy.UseNavigateStable),t=Sy(Ey.UseNavigateStable),s=_.useRef(!1);return vy(()=>{s.current=!0}),_.useCallback(function(a,u){u===void 0&&(u={}),s.current&&(typeof a=="number"?r.navigate(a):r.navigate(a,Yo({fromRouteId:t},u)))},[r,t])}const Jp={};function SS(r,t,s){Jp[r]||(Jp[r]=!0)}function _S(r,t){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function La(r){Ye(!1)}function bS(r){let{basename:t="/",children:s=null,location:o,navigationType:a=gr.Pop,navigator:u,static:d=!1,future:h}=r;ai()&&Ye(!1);let p=t.replace(/^\/*/,"/"),m=_.useMemo(()=>({basename:p,navigator:u,static:d,future:Yo({v7_relativeSplatPath:!1},h)}),[p,h,u,d]);typeof o=="string"&&(o=Ws(o));let{pathname:y="/",search:v="",hash:k="",state:L=null,key:F="default"}=o,b=_.useMemo(()=>{let x=id(y,p);return x==null?null:{location:{pathname:x,search:v,hash:k,state:L,key:F},navigationType:a}},[p,y,v,k,L,F,a]);return b==null?null:_.createElement(ns.Provider,{value:m},_.createElement(ii.Provider,{children:s,value:b}))}function kS(r){let{children:t,location:s}=r;return cS(Ac(t),s)}new Promise(()=>{});function Ac(r,t){t===void 0&&(t=[]);let s=[];return _.Children.forEach(r,(o,a)=>{if(!_.isValidElement(o))return;let u=[...t,a];if(o.type===_.Fragment){s.push.apply(s,Ac(o.props.children,u));return}o.type!==La&&Ye(!1),!o.props.index||!o.props.children||Ye(!1);let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Ac(o.props.children,u)),s.push(d)}),s}/** * React Router DOM v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Lc(){return Lc=Object.assign?Object.assign.bind():function(r){for(var t=1;t{m&&Zp?Zp(()=>p(v)):p(v)},[p,m]);return _.useLayoutEffect(()=>d.listen(y),[d,y]),_.useEffect(()=>_S(o),[o]),_.createElement(bS,{basename:t,children:s,location:h.location,navigationType:h.action,navigator:d,future:o})}const LS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",IS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mn=_.forwardRef(function(t,s){let{onClick:o,relative:a,reloadDocument:u,replace:d,state:h,target:p,to:m,preventScrollReset:y,viewTransition:v}=t,k=CS(t,PS),{basename:L}=_.useContext(ns),F,b=!1;if(typeof m=="string"&&IS.test(m)&&(F=m,LS))try{let P=new URL(window.location.href),A=m.startsWith("//")?new URL(P.protocol+m):new URL(m),V=id(A.pathname,L);A.origin===P.origin&&V!=null?m=V+A.search+A.hash:b=!0}catch{}let x=iS(m,{relative:a}),S=jS(m,{replace:d,state:h,target:p,preventScrollReset:y,relative:a,viewTransition:v});function I(P){o&&o(P),P.defaultPrevented||S(P)}return _.createElement("a",Lc({},k,{href:F||x,onClick:b||u?o:I,ref:s,target:p}))});var em;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(em||(em={}));var tm;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(tm||(tm={}));function jS(r,t){let{target:s,replace:o,state:a,preventScrollReset:u,relative:d,viewTransition:h}=t===void 0?{}:t,p=lS(),m=qs(),y=wy(r,{relative:d});return _.useCallback(v=>{if(TS(v,s)){v.preventDefault();let k=o!==void 0?o:Va(m)===Va(y);p(r,{replace:k,state:a,preventScrollReset:u,relative:d,viewTransition:h})}},[m,p,y,o,a,s,r,u,d,h])}function _y(r,t){return function(){return r.apply(t,arguments)}}const{toString:DS}=Object.prototype,{getPrototypeOf:$s}=Object,{iterator:li,toStringTag:by}=Symbol,Ha=(({hasOwnProperty:r})=>(t,s)=>r.call(t,s))(Object.prototype),Jo=(r,t)=>{let s=r;const o=[];for(;s!=null&&s!==Object.prototype;){if(o.indexOf(s)!==-1)return!1;if(o.push(s),Ha(s,t))return!0;s=$s(s)}return!1},MS=(r,t)=>r!=null&&Jo(r,t)?r[t]:void 0,ld=(r=>t=>{const s=DS.call(t);return r[s]||(r[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),cn=r=>(r=r.toLowerCase(),t=>ld(t)===r),Ka=r=>t=>typeof t===r,{isArray:Zr}=Array,Vs=Ka("undefined");function Qs(r){return r!==null&&!Vs(r)&&r.constructor!==null&&!Vs(r.constructor)&&Ot(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const ky=cn("ArrayBuffer");function FS(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&ky(r.buffer),t}const US=Ka("string"),Ot=Ka("function"),Cy=Ka("number"),Ks=r=>r!==null&&typeof r=="object",zS=r=>r===!0||r===!1,Ia=r=>{if(!Ks(r))return!1;const t=$s(r);return(t===null||t===Object.prototype||$s(t)===null)&&!Jo(r,by)&&!Jo(r,li)},BS=r=>{if(!Ks(r)||Qs(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},$S=cn("Date"),VS=cn("File"),HS=r=>!!(r&&typeof r.uri<"u"),WS=r=>r&&typeof r.getParts<"u",qS=cn("Blob"),QS=cn("FileList"),KS=r=>Ks(r)&&Ot(r.pipe);function GS(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const nm=GS(),rm=typeof nm.FormData<"u"?nm.FormData:void 0,XS=r=>{if(!r)return!1;if(rm&&r instanceof rm)return!0;const t=$s(r);if(!t||t===Object.prototype||!Ot(r.append))return!1;const s=ld(r);return s==="formdata"||s==="object"&&Ot(r.toString)&&r.toString()==="[object FormData]"},YS=cn("URLSearchParams"),[JS,ZS,e_,t_]=["ReadableStream","Request","Response","Headers"].map(cn),n_=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ui(r,t,{allOwnKeys:s=!1}={}){if(r===null||typeof r>"u")return;let o,a;if(typeof r!="object"&&(r=[r]),Zr(r))for(o=0,a=r.length;o0;)if(a=s[o],t===a.toLowerCase())return a;return null}const Fr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ty=r=>!Vs(r)&&r!==Fr;function Ic(...r){const{caseless:t,skipUndefined:s}=Ty(this)&&this||{},o={},a=(u,d)=>{if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=t&&typeof d=="string"&&Ry(o,d)||d,p=Ha(o,h)?o[h]:void 0;Ia(p)&&Ia(u)?o[h]=Ic(p,u):Ia(u)?o[h]=Ic({},u):Zr(u)?o[h]=u.slice():(!s||!Vs(u))&&(o[h]=u)};for(let u=0,d=r.length;u(ui(t,(a,u)=>{s&&Ot(a)?Object.defineProperty(r,u,{__proto__:null,value:_y(a,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,u,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),r),s_=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),o_=(r,t,s,o)=>{r.prototype=Object.create(t.prototype,o),Object.defineProperty(r.prototype,"constructor",{__proto__:null,value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{__proto__:null,value:t.prototype}),s&&Object.assign(r.prototype,s)},i_=(r,t,s,o)=>{let a,u,d;const h={};if(t=t||{},r==null)return t;do{for(a=Object.getOwnPropertyNames(r),u=a.length;u-- >0;)d=a[u],(!o||o(d,r,t))&&!h[d]&&(t[d]=r[d],h[d]=!0);r=s!==!1&&$s(r)}while(r&&(!s||s(r,t))&&r!==Object.prototype);return t},a_=(r,t,s)=>{r=String(r),(s===void 0||s>r.length)&&(s=r.length),s-=t.length;const o=r.indexOf(t,s);return o!==-1&&o===s},l_=r=>{if(!r)return null;if(Zr(r))return r;let t=r.length;if(!Cy(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=r[t];return s},u_=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&$s(Uint8Array)),c_=(r,t)=>{const o=(r&&r[li]).call(r);let a;for(;(a=o.next())&&!a.done;){const u=a.value;t.call(r,u[0],u[1])}},d_=(r,t)=>{let s;const o=[];for(;(s=r.exec(t))!==null;)o.push(s);return o},f_=cn("HTMLFormElement"),h_=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,o,a){return o.toUpperCase()+a}),{propertyIsEnumerable:p_}=Object.prototype,m_=cn("RegExp"),Py=(r,t)=>{const s=Object.getOwnPropertyDescriptors(r),o={};ui(s,(a,u)=>{let d;(d=t(a,u,r))!==!1&&(o[u]=d||a)}),Object.defineProperties(r,o)},g_=r=>{Py(r,(t,s)=>{if(Ot(r)&&["arguments","caller","callee"].includes(s))return!1;const o=r[s];if(Ot(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},y_=(r,t)=>{const s={},o=a=>{a.forEach(u=>{s[u]=!0})};return Zr(r)?o(r):o(String(r).split(t)),s},v_=()=>{},w_=(r,t)=>r!=null&&Number.isFinite(r=+r)?r:t;function x_(r){return!!(r&&Ot(r.append)&&r[by]==="FormData"&&r[li])}const E_=r=>{const t=new WeakSet,s=o=>{if(Ks(o)){if(t.has(o))return;if(Qs(o))return o;if(!("toJSON"in o)){t.add(o);const a=Zr(o)?[]:{};return ui(o,(u,d)=>{const h=s(u);!Vs(h)&&(a[d]=h)}),t.delete(o),a}}return o};return s(r)},S_=cn("AsyncFunction"),__=r=>r&&(Ks(r)||Ot(r))&&Ot(r.then)&&Ot(r.catch),Ny=((r,t)=>r?setImmediate:t?((s,o)=>(Fr.addEventListener("message",({source:a,data:u})=>{a===Fr&&u===s&&o.length&&o.shift()()},!1),a=>{o.push(a),Fr.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",Ot(Fr.postMessage)),b_=typeof queueMicrotask<"u"?queueMicrotask.bind(Fr):typeof process<"u"&&process.nextTick||Ny,Oy=r=>r!=null&&Ot(r[li]),k_=r=>r!=null&&Jo(r,li)&&Oy(r),O={isArray:Zr,isArrayBuffer:ky,isBuffer:Qs,isFormData:XS,isArrayBufferView:FS,isString:US,isNumber:Cy,isBoolean:zS,isObject:Ks,isPlainObject:Ia,isEmptyObject:BS,isReadableStream:JS,isRequest:ZS,isResponse:e_,isHeaders:t_,isUndefined:Vs,isDate:$S,isFile:VS,isReactNativeBlob:HS,isReactNative:WS,isBlob:qS,isRegExp:m_,isFunction:Ot,isStream:KS,isURLSearchParams:YS,isTypedArray:u_,isFileList:QS,forEach:ui,merge:Ic,extend:r_,trim:n_,stripBOM:s_,inherits:o_,toFlatObject:i_,kindOf:ld,kindOfTest:cn,endsWith:a_,toArray:l_,forEachEntry:c_,matchAll:d_,isHTMLForm:f_,hasOwnProperty:Ha,hasOwnProp:Ha,hasOwnInPrototypeChain:Jo,getSafeProp:MS,reduceDescriptors:Py,freezeMethods:g_,toObjectSet:y_,toCamelCase:h_,noop:v_,toFiniteNumber:w_,findKey:Ry,global:Fr,isContextDefined:Ty,isSpecCompliantForm:x_,toJSONObject:E_,isAsyncFn:S_,isThenable:__,setImmediate:Ny,asap:b_,isIterable:Oy,isSafeIterable:k_},C_=O.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),R_=r=>{const t={};let s,o,a;return r&&r.split(` `).forEach(function(d){a=d.indexOf(":"),s=d.substring(0,a).trim().toLowerCase(),o=d.substring(a+1).trim(),!(!s||t[s]&&C_[s])&&(s==="set-cookie"?t[s]?t[s].push(o):t[s]=[o]:t[s]=t[s]?t[s]+", "+o:o)}),t};function T_(r){let t=0,s=r.length;for(;tt;){const o=r.charCodeAt(s-1);if(o!==9&&o!==32)break;s-=1}return t===0&&s===r.length?r:r.slice(t,s)}const P_=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),N_=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ud(r,t){return O.isArray(r)?r.map(s=>ud(s,t)):T_(String(r).replace(t,""))}const O_=r=>ud(r,P_),A_=r=>ud(r,N_);function Ay(r){const t=Object.create(null);return O.forEach(r.toJSON(),(s,o)=>{t[o]=A_(s)}),t}const sm=Symbol("internals");function Mo(r){return r&&String(r).trim().toLowerCase()}function ja(r){return r===!1||r==null?r:O.isArray(r)?r.map(ja):O_(String(r))}function L_(r){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=s.exec(r);)t[o[1]]=o[2];return t}const I_=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Zu(r,t,s,o,a){if(O.isFunction(o))return o.call(this,t,s);if(a&&(t=s),!!O.isString(t)){if(O.isString(o))return t.indexOf(o)!==-1;if(O.isRegExp(o))return o.test(t)}}function j_(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,s,o)=>s.toUpperCase()+o)}function D_(r,t){const s=O.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(r,o+s,{__proto__:null,value:function(a,u,d){return this[o].call(this,t,a,u,d)},configurable:!0})})}let wt=class{constructor(t){t&&this.set(t)}set(t,s,o){const a=this;function u(h,p,m){const y=Mo(p);if(!y)return;const v=O.findKey(a,y);(!v||a[v]===void 0||m===!0||m===void 0&&a[v]!==!1)&&(a[v||p]=ja(h))}const d=(h,p)=>O.forEach(h,(m,y)=>u(m,y,p));if(O.isPlainObject(t)||t instanceof this.constructor)d(t,s);else if(O.isString(t)&&(t=t.trim())&&!I_(t))d(R_(t),s);else if(O.isObject(t)&&O.isSafeIterable(t)){let h=Object.create(null),p,m;for(const y of t){if(!O.isArray(y))throw new TypeError("Object iterator must return a key-value pair");m=y[0],O.hasOwnProp(h,m)?(p=h[m],h[m]=O.isArray(p)?[...p,y[1]]:[p,y[1]]):h[m]=y[1]}d(h,s)}else t!=null&&u(s,t,o);return this}get(t,s){if(t=Mo(t),t){const o=O.findKey(this,t);if(o){const a=this[o];if(!s)return a;if(s===!0)return L_(a);if(O.isFunction(s))return s.call(this,a,o);if(O.isRegExp(s))return s.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,s){if(t=Mo(t),t){const o=O.findKey(this,t);return!!(o&&this[o]!==void 0&&(!s||Zu(this,this[o],o,s)))}return!1}delete(t,s){const o=this;let a=!1;function u(d){if(d=Mo(d),d){const h=O.findKey(o,d);h&&(!s||Zu(o,o[h],h,s))&&(delete o[h],a=!0)}}return O.isArray(t)?t.forEach(u):u(t),a}clear(t){const s=Object.keys(this);let o=s.length,a=!1;for(;o--;){const u=s[o];(!t||Zu(this,this[u],u,t,!0))&&(delete this[u],a=!0)}return a}normalize(t){const s=this,o={};return O.forEach(this,(a,u)=>{const d=O.findKey(o,u);if(d){s[d]=ja(a),delete s[u];return}const h=t?j_(u):String(u).trim();h!==u&&delete s[u],s[h]=ja(a),o[h]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const s=Object.create(null);return O.forEach(this,(o,a)=>{o!=null&&o!==!1&&(s[a]=t&&O.isArray(o)?o.join(", "):o)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,s])=>t+": "+s).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){const o=new this(t);return s.forEach(a=>o.set(a)),o}static accessor(t){const o=(this[sm]=this[sm]={accessors:{}}).accessors,a=this.prototype;function u(d){const h=Mo(d);o[h]||(D_(a,d),o[h]=!0)}return O.isArray(t)?t.forEach(u):u(t),this}};wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);O.reduceDescriptors(wt.prototype,({value:r},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(o){this[s]=o}}});O.freezeMethods(wt);const M_="[REDACTED ****]";function F_(r){if(O.hasOwnProp(r,"toJSON"))return!0;let t=Object.getPrototypeOf(r);for(;t&&t!==Object.prototype;){if(O.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function U_(r,t){const s=new Set(t.map(u=>String(u).toLowerCase())),o=[],a=u=>{if(u===null||typeof u!="object"||O.isBuffer(u))return u;if(o.indexOf(u)!==-1)return;u instanceof wt&&(u=u.toJSON()),o.push(u);let d;if(O.isArray(u))d=[],u.forEach((h,p)=>{const m=a(h);O.isUndefined(m)||(d[p]=m)});else{if(!O.isPlainObject(u)&&F_(u))return o.pop(),u;d=Object.create(null);for(const[h,p]of Object.entries(u)){const m=s.has(h.toLowerCase())?M_:a(p);O.isUndefined(m)||(d[h]=m)}}return o.pop(),d};return a(r)}let Y=class Ly extends Error{static from(t,s,o,a,u,d){const h=new Ly(t.message,s||t.code,o,a,u);return Object.defineProperty(h,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),h.name=t.name,t.status!=null&&h.status==null&&(h.status=t.status),d&&Object.assign(h,d),h}constructor(t,s,o,a,u){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),o&&(this.config=o),a&&(this.request=a),u&&(this.response=u,this.status=u.status)}toJSON(){const t=this.config,s=t&&O.hasOwnProp(t,"redact")?t.redact:void 0,o=O.isArray(s)&&s.length>0?U_(t,s):O.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:o,code:this.code,status:this.status}}};Y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Y.ERR_BAD_OPTION="ERR_BAD_OPTION";Y.ECONNABORTED="ECONNABORTED";Y.ETIMEDOUT="ETIMEDOUT";Y.ECONNREFUSED="ECONNREFUSED";Y.ERR_NETWORK="ERR_NETWORK";Y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Y.ERR_DEPRECATED="ERR_DEPRECATED";Y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Y.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Y.ERR_CANCELED="ERR_CANCELED";Y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Y.ERR_INVALID_URL="ERR_INVALID_URL";Y.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const z_=null,Iy=100;function jc(r){return O.isPlainObject(r)||O.isArray(r)}function jy(r){return O.endsWith(r,"[]")?r.slice(0,-2):r}function ec(r,t,s){return r?r.concat(t).map(function(a,u){return a=jy(a),!s&&u?"["+a+"]":a}).join(s?".":""):t}function B_(r){return O.isArray(r)&&!r.some(jc)}const $_=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function Ga(r,t,s){if(!O.isObject(r))throw new TypeError("target must be an object");t=t||new FormData,s=O.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,P){return!O.isUndefined(P[I])});const o=s.metaTokens,a=s.visitor||F,u=s.dots,d=s.indexes,h=s.Blob||typeof Blob<"u"&&Blob,p=s.maxDepth===void 0?Iy:s.maxDepth,m=h&&O.isSpecCompliantForm(t),y=[];if(!O.isFunction(a))throw new TypeError("visitor must be a function");function v(S){if(S===null)return"";if(O.isDate(S))return S.toISOString();if(O.isBoolean(S))return S.toString();if(!m&&O.isBlob(S))throw new Y("Blob is not supported. Use a Buffer instead.");if(O.isArrayBuffer(S)||O.isTypedArray(S)){if(m&&typeof h=="function")return new h([S]);if(typeof Buffer<"u")return Buffer.from(S);throw new Y("Blob is not supported. Use a Buffer instead.",Y.ERR_NOT_SUPPORT)}return S}function k(S){if(S>p)throw new Y("Object is too deeply nested ("+S+" levels). Max depth: "+p,Y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function L(S,I){if(p===1/0)return JSON.stringify(S);const P=[];return JSON.stringify(S,function(V,$){if(!O.isObject($))return $;for(;P.length&&P[P.length-1]!==this;)P.pop();return P.push($),k(I+P.length-1),$})}function F(S,I,P){let A=S;if(O.isReactNative(t)&&O.isReactNativeBlob(S))return t.append(ec(P,I,u),v(S)),!1;if(S&&!P&&typeof S=="object"){if(O.endsWith(I,"{}"))I=o?I:I.slice(0,-2),S=L(S,1);else if(O.isArray(S)&&B_(S)||(O.isFileList(S)||O.endsWith(I,"[]"))&&(A=O.toArray(S)))return I=jy(I),A.forEach(function($,G){!(O.isUndefined($)||$===null)&&t.append(d===!0?ec([I],G,u):d===null?I:I+"[]",v($))}),!1}return jc(S)?!0:(t.append(ec(P,I,u),v(S)),!1)}const b=Object.assign($_,{defaultVisitor:F,convertValue:v,isVisitable:jc});function x(S,I,P=0){if(!O.isUndefined(S)){if(k(P),y.indexOf(S)!==-1)throw new Error("Circular reference detected in "+I.join("."));y.push(S),O.forEach(S,function(V,$){(!(O.isUndefined(V)||V===null)&&a.call(t,V,O.isString($)?$.trim():$,I,b))===!0&&x(V,I?I.concat($):[$],P+1)}),y.pop()}}if(!O.isObject(r))throw new TypeError("data must be an object");return x(r),t}function om(r){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(r).replace(/[!'()~]|%20/g,function(o){return t[o]})}function cd(r,t){this._pairs=[],r&&Ga(r,this,t)}const Dy=cd.prototype;Dy.append=function(t,s){this._pairs.push([t,s])};Dy.toString=function(t){const s=t?o=>t.call(this,o,om):om;return this._pairs.map(function(a){return s(a[0])+"="+s(a[1])},"").join("&")};function V_(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function My(r,t,s){if(!t)return r;r=r||"";const o=O.isFunction(s)?{serialize:s}:s,a=O.getSafeProp(o,"encode")||V_,u=O.getSafeProp(o,"serialize");let d;if(u?d=u(t,o):d=O.isURLSearchParams(t)?t.toString():new cd(t,o).toString(a),d){const h=r.indexOf("#");h!==-1&&(r=r.slice(0,h)),r+=(r.indexOf("?")===-1?"?":"&")+d}return r}class im{constructor(){this.handlers=[]}use(t,s,o){return this.handlers.push({fulfilled:t,rejected:s,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){O.forEach(this.handlers,function(o){o!==null&&t(o)})}}const dd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},H_=typeof URLSearchParams<"u"?URLSearchParams:cd,W_=typeof FormData<"u"?FormData:null,q_=typeof Blob<"u"?Blob:null,Q_={isBrowser:!0,classes:{URLSearchParams:H_,FormData:W_,Blob:q_},protocols:["http","https","file","blob","url","data"]},fd=typeof window<"u"&&typeof document<"u",Dc=typeof navigator=="object"&&navigator||void 0,K_=fd&&(!Dc||["ReactNative","NativeScript","NS"].indexOf(Dc.product)<0),G_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",X_=fd&&window.location.href||"http://localhost",Y_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fd,hasStandardBrowserEnv:K_,hasStandardBrowserWebWorkerEnv:G_,navigator:Dc,origin:X_},Symbol.toStringTag,{value:"Module"})),ft={...Y_,...Q_};function J_(r,t){return Ga(r,new ft.classes.URLSearchParams,{visitor:function(s,o,a,u){return ft.isNode&&O.isBuffer(s)?(this.append(o,s.toString("base64")),!1):u.defaultVisitor.apply(this,arguments)},...t})}const am=Iy;function Fy(r){if(r>am)throw new Y("FormData field is too deeply nested ("+r+" levels). Max depth: "+am,Y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Z_(r){const t=[],s=/\w+|\[(\w*)]/g;let o;for(;(o=s.exec(r))!==null;)Fy(t.length),t.push(o[0]==="[]"?"":o[1]||o[0]);return t}function eb(r){const t={},s=Object.keys(r);let o;const a=s.length;let u;for(o=0;o=s.length;return d=!d&&O.isArray(a)?a.length:d,p?(O.hasOwnProp(a,d)?a[d]=O.isArray(a[d])?a[d].concat(o):[a[d],o]:a[d]=o,!h):((!O.hasOwnProp(a,d)||!O.isObject(a[d]))&&(a[d]=[]),t(s,o,a[d],u)&&O.isArray(a[d])&&(a[d]=eb(a[d])),!h)}if(O.isFormData(r)&&O.isFunction(r.entries)){const s={};return O.forEachEntry(r,(o,a)=>{t(Z_(o),a,s,0)}),s}return null}const Ts=(r,t)=>r!=null&&O.hasOwnProp(r,t)?r[t]:void 0;function tb(r,t,s){if(O.isString(r))try{return(t||JSON.parse)(r),O.trim(r)}catch(o){if(o.name!=="SyntaxError")throw o}return(s||JSON.stringify)(r)}const ci={transitional:dd,adapter:["xhr","http","fetch"],transformRequest:[function(t,s){const o=s.getContentType()||"",a=o.indexOf("application/json")>-1,u=O.isObject(t);if(u&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return a?JSON.stringify(Uy(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t)||O.isReadableStream(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;if(u){const p=Ts(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return J_(t,p).toString();if((h=O.isFileList(t))||o.indexOf("multipart/form-data")>-1){const m=Ts(this,"env"),y=m&&m.FormData;return Ga(h?{"files[]":t}:t,y&&new y,p)}}return u||a?(s.setContentType("application/json",!1),tb(t)):t}],transformResponse:[function(t){const s=Ts(this,"transitional")||ci.transitional,o=s&&s.forcedJSONParsing,a=Ts(this,"responseType"),u=a==="json";if(O.isResponse(t)||O.isReadableStream(t))return t;if(t&&O.isString(t)&&(o&&!a||u)){const h=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(t,Ts(this,"parseReviver"))}catch(p){if(h)throw p.name==="SyntaxError"?Y.from(p,Y.ERR_BAD_RESPONSE,this,null,Ts(this,"response")):p}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch","query"],r=>{ci.headers[r]={}});function tc(r,t){const s=this||ci,o=t||s,a=wt.from(o.headers);let u=o.data;return O.forEach(r,function(h){u=h.call(s,u,a.normalize(),t?t.status:void 0)}),a.normalize(),u}function zy(r){return!!(r&&r.__CANCEL__)}let di=class extends Y{constructor(t,s,o){super(t??"canceled",Y.ERR_CANCELED,s,o),this.name="CanceledError",this.__CANCEL__=!0}};function By(r,t,s){const o=s.config.validateStatus;!s.status||!o||o(s.status)?r(s):t(new Y("Request failed with status code "+s.status,s.status>=400&&s.status<500?Y.ERR_BAD_REQUEST:Y.ERR_BAD_RESPONSE,s.config,s.request,s))}function nb(r){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(r);return t&&t[1]||""}function rb(r,t){r=r||10;const s=new Array(r),o=new Array(r);let a=0,u=0,d;return t=t!==void 0?t:1e3,function(p){const m=Date.now(),y=o[u];d||(d=m),s[a]=p,o[a]=m;let v=u,k=0;for(;v!==a;)k+=s[v++],v=v%r;if(a=(a+1)%r,a===u&&(u=(u+1)%r),m-d{s=y,a=null,u&&(clearTimeout(u),u=null),r(...m)};return[(...m)=>{const y=Date.now(),v=y-s;v>=o?d(m,y):(a=m,u||(u=setTimeout(()=>{u=null,d(a)},o-v)))},()=>a&&d(a)]}const Wa=(r,t,s=3)=>{let o=0;const a=rb(50,250);return sb(u=>{if(!u||typeof u.loaded!="number")return;const d=u.loaded,h=u.lengthComputable?u.total:void 0,p=h!=null?Math.min(d,h):d,m=Math.max(0,p-o),y=a(m);o=Math.max(o,p);const v={loaded:p,total:h,progress:h?p/h:void 0,bytes:m,rate:y||void 0,estimated:y&&h?(h-p)/y:void 0,event:u,lengthComputable:h!=null,[t?"download":"upload"]:!0};r(v)},s)},lm=(r,t)=>{const s=r!=null;return[o=>t[0]({lengthComputable:s,total:r,loaded:o}),t[1]]},um=r=>(...t)=>O.asap(()=>r(...t)),ob=ft.hasStandardBrowserEnv?((r,t)=>s=>(s=new URL(s,ft.origin),r.protocol===s.protocol&&r.host===s.host&&(t||r.port===s.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,ib=ft.hasStandardBrowserEnv?{write(r,t,s,o,a,u,d){if(typeof document>"u")return;const h=[`${r}=${encodeURIComponent(t)}`];O.isNumber(s)&&h.push(`expires=${new Date(s).toUTCString()}`),O.isString(o)&&h.push(`path=${o}`),O.isString(a)&&h.push(`domain=${a}`),u===!0&&h.push("secure"),O.isString(d)&&h.push(`SameSite=${d}`),document.cookie=h.join("; ")},read(r){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let s=0;sr instanceof wt?{...r}:r;function es(r,t){r=r||{},t=t||{};const s=Object.create(null);Object.defineProperty(s,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function o(y,v,k,L){return O.isPlainObject(y)&&O.isPlainObject(v)?O.merge.call({caseless:L},y,v):O.isPlainObject(v)?O.merge({},v):O.isArray(v)?v.slice():v}function a(y,v,k,L){if(O.isUndefined(v)){if(!O.isUndefined(y))return o(void 0,y,k,L)}else return o(y,v,k,L)}function u(y,v){if(!O.isUndefined(v))return o(void 0,v)}function d(y,v){if(O.isUndefined(v)){if(!O.isUndefined(y))return o(void 0,y)}else return o(void 0,v)}function h(y){const v=O.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!O.isUndefined(v))if(O.isPlainObject(v)){if(O.hasOwnProp(v,y))return v[y]}else return;const k=O.hasOwnProp(r,"transitional")?r.transitional:void 0;if(O.isPlainObject(k)&&O.hasOwnProp(k,y))return k[y]}function p(y,v,k){if(O.hasOwnProp(t,k))return o(y,v);if(O.hasOwnProp(r,k))return o(void 0,y)}const m={url:u,method:u,data:u,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,allowedSocketPaths:d,responseEncoding:d,validateStatus:p,headers:(y,v,k)=>a(dm(y),dm(v),k,!0)};return O.forEach(Object.keys({...r,...t}),function(v){if(v==="__proto__"||v==="constructor"||v==="prototype")return;const k=O.hasOwnProp(m,v)?m[v]:a,L=O.hasOwnProp(r,v)?r[v]:void 0,F=O.hasOwnProp(t,v)?t[v]:void 0,b=k(L,F,v);O.isUndefined(b)&&k!==p||(s[v]=b)}),O.hasOwnProp(t,"validateStatus")&&O.isUndefined(t.validateStatus)&&h("validateStatusUndefinedResolves")===!1&&(O.hasOwnProp(r,"validateStatus")?s.validateStatus=o(void 0,r.validateStatus):delete s.validateStatus),s}const hb=["content-type","content-length"];function pb(r,t,s){if(s!=="content-only"){r.set(t);return}Object.entries(t||{}).forEach(([o,a])=>{hb.includes(o.toLowerCase())&&r.set(o,a)})}const mb=r=>encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(t,s)=>String.fromCharCode(parseInt(s,16)));function Vy(r){const t=es({},r),s=k=>O.hasOwnProp(t,k)?t[k]:void 0,o=s("data");let a=s("withXSRFToken");const u=s("xsrfHeaderName"),d=s("xsrfCookieName");let h=s("headers");const p=s("auth"),m=s("baseURL"),y=s("allowAbsoluteUrls"),v=s("url");if(t.headers=h=wt.from(h),t.url=My($y(m,v,y,t),s("params"),s("paramsSerializer")),p){const k=O.getSafeProp(p,"username")||"",L=O.getSafeProp(p,"password")||"";try{h.set("Authorization","Basic "+btoa(k+":"+(L?mb(L):"")))}catch(F){throw Y.from(F,Y.ERR_BAD_OPTION_VALUE,r)}}if(O.isFormData(o)&&(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv||O.isReactNative(o)?h.setContentType(void 0):O.isFunction(o.getHeaders)&&pb(h,o.getHeaders(),s("formDataHeaderPolicy"))),ft.hasStandardBrowserEnv&&(O.isFunction(a)&&(a=a(t)),a===!0||a==null&&ob(t.url))){const L=u&&d&&ib.read(d);L&&h.set(u,L)}return t}const gb=typeof XMLHttpRequest<"u",yb=gb&&function(r){return new Promise(function(s,o){const a=Vy(r);let u=a.data;const d=wt.from(a.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:m}=a,y,v,k,L,F;function b(){L&&L(),F&&F(),a.cancelToken&&a.cancelToken.unsubscribe(y),a.signal&&a.signal.removeEventListener("abort",y)}let x=new XMLHttpRequest;x.open(a.method.toUpperCase(),a.url,!0),x.timeout=a.timeout;function S(){if(!x)return;const P=wt.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),V={data:!h||h==="text"||h==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:P,config:r,request:x};By(function(G){s(G),b()},function(G){o(G),b()},V),x=null}"onloadend"in x?x.onloadend=S:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.startsWith("file:"))||setTimeout(S)},x.onabort=function(){x&&(o(new Y("Request aborted",Y.ECONNABORTED,r,x)),b(),x=null)},x.onerror=function(A){const V=A&&A.message?A.message:"Network Error",$=new Y(V,Y.ERR_NETWORK,r,x);$.event=A||null,o($),b(),x=null},x.ontimeout=function(){let A=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const V=a.transitional||dd;a.timeoutErrorMessage&&(A=a.timeoutErrorMessage),o(new Y(A,V.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,r,x)),b(),x=null},u===void 0&&d.setContentType(null),"setRequestHeader"in x&&O.forEach(Ay(d),function(A,V){x.setRequestHeader(V,A)}),O.isUndefined(a.withCredentials)||(x.withCredentials=!!a.withCredentials),h&&h!=="json"&&(x.responseType=a.responseType),m&&([k,F]=Wa(m,!0),x.addEventListener("progress",k)),p&&x.upload&&([v,L]=Wa(p),x.upload.addEventListener("progress",v),x.upload.addEventListener("loadend",L)),(a.cancelToken||a.signal)&&(y=P=>{x&&(o(!P||P.type?new di(null,r,x):P),x.abort(),b(),x=null)},a.cancelToken&&a.cancelToken.subscribe(y),a.signal&&(a.signal.aborted?y():a.signal.addEventListener("abort",y)));const I=nb(a.url);if(I&&!ft.protocols.includes(I)){o(new Y("Unsupported protocol "+I+":",Y.ERR_BAD_REQUEST,r)),b();return}x.send(u||null)})},vb=(r,t)=>{if(r=r?r.filter(Boolean):[],!t&&!r.length)return;const s=new AbortController;let o=!1;const a=function(p){if(!o){o=!0,d();const m=p instanceof Error?p:this.reason;s.abort(m instanceof Y?m:new di(m instanceof Error?m.message:m))}};let u=t&&setTimeout(()=>{u=null,a(new Y(`timeout of ${t}ms exceeded`,Y.ETIMEDOUT))},t);const d=()=>{r&&(u&&clearTimeout(u),u=null,r.forEach(p=>{p.unsubscribe?p.unsubscribe(a):p.removeEventListener("abort",a)}),r=null)};r.forEach(p=>p.addEventListener("abort",a,{once:!0}));const{signal:h}=s;return h.unsubscribe=()=>O.asap(d),h},wb=function*(r,t){let s=r.byteLength;if(s{const a=xb(r,t);let u=0,d,h=p=>{d||(d=!0,o&&o(p))};return new ReadableStream({async pull(p){try{const{done:m,value:y}=await a.next();if(m){h(),p.close();return}let v=y.byteLength;if(s){let k=u+=v;s(k)}p.enqueue(new Uint8Array(y))}catch(m){throw h(m),m}},cancel(p){return h(p),a.return()}},{highWaterMark:2})},qa=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,Sb=(r,t,s)=>t+2L>=2&&o.charCodeAt(L-2)===37&&o.charCodeAt(L-1)===51&&(o.charCodeAt(L)===68||o.charCodeAt(L)===100);m>=0&&(o.charCodeAt(m)===61?(p++,m--):y(m)&&(p++,m-=3)),p===1&&m>=0&&(o.charCodeAt(m)===61||y(m))&&p++;const k=Math.floor(d/4)*3-(p||0);return k>0?k:0}let u=0;for(let d=0,h=o.length;d=55296&&p<=56319&&d+1=56320&&m<=57343?(u+=4,d++):u+=3}else u+=3}return u}const hd="1.18.1",hm=64*1024,{isFunction:Ra}=O,bb=r=>encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(t,s)=>String.fromCharCode(parseInt(s,16))),pm=r=>{if(!O.isString(r))return r;try{return decodeURIComponent(r)}catch{return r}},mm=(r,...t)=>{try{return!!r(...t)}catch{return!1}},kb=r=>{const t=r.indexOf("://");let s=r;return t!==-1&&(s=s.slice(t+3)),s.includes("@")||s.includes(":")},Cb=r=>{const t=O.global!==void 0&&O.global!==null?O.global:globalThis,{ReadableStream:s,TextEncoder:o}=t;r=O.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},r);const{fetch:a,Request:u,Response:d}=r,h=a?Ra(a):typeof fetch=="function",p=Ra(u),m=Ra(d);if(!h)return!1;const y=h&&Ra(s),v=h&&(typeof o=="function"?(S=>I=>S.encode(I))(new o):async S=>new Uint8Array(await new u(S).arrayBuffer())),k=p&&y&&mm(()=>{let S=!1;const I=new u(ft.origin,{body:new s,method:"POST",get duplex(){return S=!0,"half"}}),P=I.headers.has("Content-Type");return I.body!=null&&I.body.cancel(),S&&!P}),L=m&&y&&mm(()=>O.isReadableStream(new d("").body)),F={stream:L&&(S=>S.body)};h&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!F[S]&&(F[S]=(I,P)=>{let A=I&&I[S];if(A)return A.call(I);throw new Y(`Response type '${S}' is not supported`,Y.ERR_NOT_SUPPORT,P)})});const b=async S=>{if(S==null)return 0;if(O.isBlob(S))return S.size;if(O.isSpecCompliantForm(S))return(await new u(ft.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(O.isArrayBufferView(S)||O.isArrayBuffer(S))return S.byteLength;if(O.isURLSearchParams(S)&&(S=S+""),O.isString(S))return(await v(S)).byteLength},x=async(S,I)=>{const P=O.toFiniteNumber(S.getContentLength());return P??b(I)};return async S=>{let{url:I,method:P,data:A,signal:V,cancelToken:$,timeout:G,onDownloadProgress:B,onUploadProgress:ie,responseType:ue,headers:Ee,withCredentials:Te="same-origin",fetchOptions:xe,maxContentLength:J,maxBodyLength:_e}=Vy(S);const Se=O.isNumber(J)&&J>-1,be=O.isNumber(_e)&&_e>-1,K=X=>O.hasOwnProp(S,X)?S[X]:void 0;let ae=a||fetch;ue=ue?(ue+"").toLowerCase():"text";let U=vb([V,$&&$.toAbortSignal()],G),N=null;const z=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let ce,me=null;const he=()=>new Y("Request body larger than maxBodyLength limit",Y.ERR_BAD_REQUEST,S,N);try{let X;const ve=K("auth");if(ve){const we=O.getSafeProp(ve,"username")||"",at=O.getSafeProp(ve,"password")||"";X={username:we,password:at}}if(kb(I)){const we=new URL(I,ft.origin);if(!X&&(we.username||we.password)){const at=pm(we.username),Yt=pm(we.password);X={username:at,password:Yt}}(we.username||we.password)&&(we.username="",we.password="",I=we.href)}if(X&&(Ee.delete("authorization"),Ee.set("Authorization","Basic "+btoa(bb((X.username||"")+":"+(X.password||""))))),Se&&typeof I=="string"&&I.startsWith("data:")&&_b(I)>J)throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,S,N);if(be&&P!=="get"&&P!=="head"){const we=await b(A);if(typeof we=="number"&&isFinite(we)&&(ce=we,we>_e))throw he()}const Re=be&&(O.isReadableStream(A)||O.isStream(A)),ye=(we,at,Yt)=>fm(we,hm,Jt=>{if(be&&Jt>_e)throw me=he();at&&at(Jt)},Yt);if(k&&P!=="get"&&P!=="head"&&(ie||Re)){if(ce=ce??await x(Ee,A),ce!==0||Re){let we=new u(I,{method:"POST",body:A,duplex:"half"}),at;if(O.isFormData(A)&&(at=we.headers.get("content-type"))&&Ee.setContentType(at),we.body){const[Yt,Jt]=ie&&lm(ce,Wa(um(ie)))||[];A=ye(we.body,Yt,Jt)}}}else if(Re&&!p&&y&&P!=="get"&&P!=="head")A=ye(A);else if(Re&&p&&!k&&P!=="get"&&P!=="head")throw new Y("Stream request bodies are not supported by the current fetch implementation",Y.ERR_NOT_SUPPORT,S,N);O.isString(Te)||(Te=Te?"include":"omit");const tt=p&&"credentials"in u.prototype;if(O.isFormData(A)){const we=Ee.getContentType();we&&/^multipart\/form-data/i.test(we)&&!/boundary=/i.test(we)&&Ee.delete("content-type")}Ee.set("User-Agent","axios/"+hd,!1);const Ft={...xe,signal:U,method:P.toUpperCase(),headers:Ay(Ee.normalize()),body:A,duplex:"half",credentials:tt?Te:void 0};N=p&&new u(I,Ft);let it=await(p?ae(N,xe):ae(I,Ft));const Xt=wt.from(it.headers);if(Se){const we=O.toFiniteNumber(Xt.getContentLength());if(we!=null&&we>J)throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,S,N)}const Ut=L&&(ue==="stream"||ue==="response");if(L&&it.body&&(B||Se||Ut&&z)){const we={};["status","statusText","headers"].forEach(Sn=>{we[Sn]=it[Sn]});const at=O.toFiniteNumber(Xt.getContentLength()),[Yt,Jt]=B&&lm(at,Wa(um(B),!0))||[];let Fn=0;const Un=Sn=>{if(Se&&(Fn=Sn,Fn>J))throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,S,N);Yt&&Yt(Sn)};it=new d(fm(it.body,hm,Un,()=>{Jt&&Jt(),z&&z()}),we)}ue=ue||"text";let zt=await F[O.findKey(F,ue)||"text"](it,S);if(Se&&!L&&!Ut){let we;if(zt!=null&&(typeof zt.byteLength=="number"?we=zt.byteLength:typeof zt.size=="number"?we=zt.size:typeof zt=="string"&&(we=typeof o=="function"?new o().encode(zt).byteLength:zt.length)),typeof we=="number"&&we>J)throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,S,N)}return!Ut&&z&&z(),await new Promise((we,at)=>{By(we,at,{data:zt,headers:wt.from(it.headers),status:it.status,statusText:it.statusText,config:S,request:N})})}catch(X){if(z&&z(),U&&U.aborted&&U.reason instanceof Y){const ve=U.reason;throw ve.config=S,N&&(ve.request=N),X!==ve&&Object.defineProperty(ve,"cause",{__proto__:null,value:X,writable:!0,enumerable:!1,configurable:!0}),ve}if(me)throw N&&!me.request&&(me.request=N),me;if(X instanceof Y)throw N&&!X.request&&(X.request=N),X;if(X&&X.name==="TypeError"&&/Load failed|fetch/i.test(X.message)){const ve=new Y("Network Error",Y.ERR_NETWORK,S,N,X&&X.response);throw Object.defineProperty(ve,"cause",{__proto__:null,value:X.cause||X,writable:!0,enumerable:!1,configurable:!0}),ve}throw Y.from(X,X&&X.code,S,N,X&&X.response)}}},Rb=new Map,Hy=r=>{let t=r&&r.env||{};const{fetch:s,Request:o,Response:a}=t,u=[o,a,s];let d=u.length,h=d,p,m,y=Rb;for(;h--;)p=u[h],m=y.get(p),m===void 0&&y.set(p,m=h?new Map:Cb(t)),y=m;return m};Hy();const pd={http:z_,xhr:yb,fetch:{get:Hy}};O.forEach(pd,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(r,"adapterName",{__proto__:null,value:t})}});const gm=r=>`- ${r}`,Tb=r=>O.isFunction(r)||r===null||r===!1;function Pb(r,t){r=O.isArray(r)?r:[r];const{length:s}=r;let o,a;const u={};for(let d=0;d`adapter ${p} `+(m===!1?"is not supported by the environment":"is not available in the build"));let h=s?d.length>1?`since : `+d.map(gm).join(` `):" "+gm(d[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+h,Y.ERR_NOT_SUPPORT)}return a}const Wy={getAdapter:Pb,adapters:pd};function nc(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new di(null,r)}function ym(r){return nc(r),r.headers=wt.from(r.headers),r.data=tc.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Wy.getAdapter(r.adapter||ci.adapter,r)(r).then(function(o){nc(r),r.response=o;try{o.data=tc.call(r,r.transformResponse,o)}finally{delete r.response}return o.headers=wt.from(o.headers),o},function(o){if(!zy(o)&&(nc(r),o&&o.response)){r.response=o.response;try{o.response.data=tc.call(r,r.transformResponse,o.response)}finally{delete r.response}o.response.headers=wt.from(o.response.headers)}return Promise.reject(o)})}const Xa={};["object","boolean","number","function","string","symbol"].forEach((r,t)=>{Xa[r]=function(o){return typeof o===r||"a"+(t<1?"n ":" ")+r}});const vm={};Xa.transitional=function(t,s,o){function a(u,d){return"[Axios v"+hd+"] Transitional option '"+u+"'"+d+(o?". "+o:"")}return(u,d,h)=>{if(t===!1)throw new Y(a(d," has been removed"+(s?" in "+s:"")),Y.ERR_DEPRECATED);return s&&!vm[d]&&(vm[d]=!0,console.warn(a(d," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(u,d,h):!0}};Xa.spelling=function(t){return(s,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function Nb(r,t,s){if(typeof r!="object"||r===null)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const o=Object.keys(r);let a=o.length;for(;a-- >0;){const u=o[a],d=Object.prototype.hasOwnProperty.call(t,u)?t[u]:void 0;if(d){const h=r[u],p=h===void 0||d(h,u,r);if(p!==!0)throw new Y("option "+u+" must be "+p,Y.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new Y("Unknown option "+u,Y.ERR_BAD_OPTION)}}const Da={assertOptions:Nb,validators:Xa},yt=Da.validators;let Kr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new im,response:new im}}async request(t,s){try{return await this._request(t,s)}catch(o){if(o instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const u=(()=>{if(!a.stack)return"";const d=a.stack.indexOf(` `);return d===-1?"":a.stack.slice(d+1)})();try{if(!o.stack)o.stack=u;else if(u){const d=u.indexOf(` `),h=d===-1?-1:u.indexOf(` `,d+1),p=h===-1?"":u.slice(h+1);String(o.stack).endsWith(p)||(o.stack+=` `+u)}}catch{}}throw o}}_request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=es(this.defaults,s);const{transitional:o,paramsSerializer:a,headers:u}=s;o!==void 0&&Da.assertOptions(o,{silentJSONParsing:yt.transitional(yt.boolean),forcedJSONParsing:yt.transitional(yt.boolean),clarifyTimeoutError:yt.transitional(yt.boolean),legacyInterceptorReqResOrdering:yt.transitional(yt.boolean),advertiseZstdAcceptEncoding:yt.transitional(yt.boolean),validateStatusUndefinedResolves:yt.transitional(yt.boolean)},!1),a!=null&&(O.isFunction(a)?s.paramsSerializer={serialize:a}:Da.assertOptions(a,{encode:yt.function,serialize:yt.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),Da.assertOptions(s,{baseUrl:yt.spelling("baseURL"),withXsrfToken:yt.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let d=u&&O.merge(u.common,u[s.method]);u&&O.forEach(["delete","get","head","post","put","patch","query","common"],F=>{delete u[F]}),s.headers=wt.concat(d,u);const h=[];let p=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(s)===!1)return;p=p&&b.synchronous;const x=s.transitional||dd;x&&x.legacyInterceptorReqResOrdering?h.unshift(b.fulfilled,b.rejected):h.push(b.fulfilled,b.rejected)});const m=[];this.interceptors.response.forEach(function(b){m.push(b.fulfilled,b.rejected)});let y,v=0,k;if(!p){const F=[ym.bind(this),void 0];for(F.unshift(...h),F.push(...m),k=F.length,y=Promise.resolve(s);v{if(!o._listeners)return;let u=o._listeners.length;for(;u-- >0;)o._listeners[u](a);o._listeners=null}),this.promise.then=a=>{let u;const d=new Promise(h=>{o.subscribe(h),u=h}).then(a);return d.cancel=function(){o.unsubscribe(u)},d},t(function(u,d,h){o.reason||(o.reason=new di(u,d,h),s(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const t=new AbortController,s=o=>{t.abort(o)};return this.subscribe(s),t.signal.unsubscribe=()=>this.unsubscribe(s),t.signal}static source(){let t;return{token:new qy(function(a){t=a}),cancel:t}}};function Ab(r){return function(s){return r.apply(null,s)}}function Lb(r){return O.isObject(r)&&r.isAxiosError===!0}const Mc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Mc).forEach(([r,t])=>{Mc[t]=r});function Qy(r){const t=new Kr(r),s=_y(Kr.prototype.request,t);return O.extend(s,Kr.prototype,t,{allOwnKeys:!0}),O.extend(s,t,null,{allOwnKeys:!0}),s.create=function(a){return Qy(es(r,a))},s}const Ke=Qy(ci);Ke.Axios=Kr;Ke.CanceledError=di;Ke.CancelToken=Ob;Ke.isCancel=zy;Ke.VERSION=hd;Ke.toFormData=Ga;Ke.AxiosError=Y;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=Ab;Ke.isAxiosError=Lb;Ke.mergeConfig=es;Ke.AxiosHeaders=wt;Ke.formToJSON=r=>Uy(O.isHTMLForm(r)?new FormData(r):r);Ke.getAdapter=Wy.getAdapter;Ke.HttpStatusCode=Mc;Ke.default=Ke;const{Axios:sR,AxiosError:oR,CanceledError:iR,isCancel:aR,CancelToken:lR,VERSION:uR,all:cR,Cancel:dR,isAxiosError:fR,spread:hR,toFormData:pR,AxiosHeaders:mR,HttpStatusCode:gR,formToJSON:yR,getAdapter:vR,mergeConfig:wR,create:xR}=Ke,Ky=typeof window>"u",wm=!Ky&&window.self!==window.top,Ib=!Ky&&typeof document>"u",rc=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),ct=[];for(let r=0;r<256;++r)ct.push((r+256).toString(16).slice(1));function jb(r,t=0){return(ct[r[t+0]]+ct[r[t+1]]+ct[r[t+2]]+ct[r[t+3]]+"-"+ct[r[t+4]]+ct[r[t+5]]+"-"+ct[r[t+6]]+ct[r[t+7]]+"-"+ct[r[t+8]]+ct[r[t+9]]+"-"+ct[r[t+10]]+ct[r[t+11]]+ct[r[t+12]]+ct[r[t+13]]+ct[r[t+14]]+ct[r[t+15]]).toLowerCase()}let sc;const Db=new Uint8Array(16);function Mb(){if(!sc){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");sc=crypto.getRandomValues.bind(crypto)}return sc(Db)}const Fb=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xm={randomUUID:Fb};function Ub(r,t,s){var a;r=r||{};const o=r.random??((a=r.rng)==null?void 0:a.call(r))??Mb();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,jb(o)}function zb(r,t,s){return xm.randomUUID&&!r?xm.randomUUID():Ub(r)}const Fo=typeof window<"u"?window:{base44SharedInstances:{}};function Bb(r,t){return Fo.base44SharedInstances||(Fo.base44SharedInstances={}),Fo.base44SharedInstances[r]||(Fo.base44SharedInstances[r]={instance:t()}),Fo.base44SharedInstances[r].instance}const $b="__user_heartbeat_event__",Vb="__initialization_event__",Hb="__session_duration_event__",Em="analytics-enable",Sm="base44_analytics_session_id",Wb={enabled:!0,maxQueueSize:1e3,throttleTime:1e3,batchSize:30,heartBeatInterval:60*1e3},qb="analytics",Me=Bb(qb,()=>({requestsQueue:[],isProcessing:!1,isHeartBeatProcessing:!1,wasInitializationTracked:!1,sessionContext:null,sessionStartTime:null,config:{...Wb,...ek()}})),Qb=({axiosClient:r,serverUrl:t,appId:s,userAuthModule:o})=>{var a;const{maxQueueSize:u,throttleTime:d,batchSize:h}=Me.config;if(!(!((a=Me.config)===null||a===void 0)&&a.enabled)||Ib)return{track:()=>{},cleanup:()=>{}};let p;const m=`${t}/api/apps/${s}/analytics/track/batch`,y=async P=>{await r.request({method:"POST",url:`/apps/${s}/analytics/track/batch`,data:{events:P}})},v=P=>{try{const A=JSON.stringify({events:P}),V=new Blob([A],{type:"application/json"});return typeof navigator>"u"||A.length>6e4||!navigator.sendBeacon(m,V)}catch{return!1}},k=async(P,A={})=>{if(P.length===0)return;const V=await Zb(o),$=P.map(Jb(V));try{(!A.isBeacon||!v($))&&await y($)}catch{}},L=()=>{bm(k,{throttleTime:d,batchSize:h})},F=P=>{if(Me.requestsQueue.length>=u)return;const A=Yb();Me.requestsQueue.push({...P,...A}),L()},b=()=>{bm(k,{throttleTime:d,batchSize:h}),p=km(F),Gb()},x=()=>{_m(),p==null||p(),Xb(F);const P=Me.requestsQueue.splice(0);k(P,{isBeacon:!0})},S=()=>{typeof window>"u"||(document.visibilityState==="hidden"?x():document.visibilityState==="visible"&&b())},I=()=>{_m(),p==null||p(),typeof window<"u"&&window.removeEventListener("visibilitychange",S)};return L(),p=km(F),Kb(F),typeof window<"u"&&window.addEventListener("visibilitychange",S),{track:F,cleanup:I}};function _m(){Me.isProcessing=!1}async function bm(r,t){if(Me.isProcessing)return;Me.isProcessing=!0;const{throttleTime:s=1e3,batchSize:o=30}=t??{};for(;Me.isProcessing&&Me.requestsQueue.length>0;){const a=Me.requestsQueue.splice(0,o);a.length&&await r(a),await new Promise(u=>setTimeout(u,s))}Me.isProcessing=!1}function km(r){var t;if(Me.isHeartBeatProcessing||((t=Me.config.heartBeatInterval)!==null&&t!==void 0?t:0)<10)return()=>{};Me.isHeartBeatProcessing=!0;const s=setInterval(()=>{r({eventName:$b})},Me.config.heartBeatInterval);return()=>{clearInterval(s),Me.isHeartBeatProcessing=!1}}function Kb(r){typeof window>"u"||Me.wasInitializationTracked||(Me.wasInitializationTracked=!0,r({eventName:Vb,properties:{referrer:document==null?void 0:document.referrer}}))}function Gb(){typeof window>"u"||Me.sessionStartTime!==null||(Me.sessionStartTime=new Date().toISOString())}function Xb(r){if(typeof window>"u"||Me.sessionStartTime===null)return;const t=new Date().getTime()-new Date(Me.sessionStartTime).getTime();Me.sessionStartTime=null,r({eventName:Hb,properties:{sessionDuration:t}})}function Yb(){return{timestamp:new Date().toISOString(),pageUrl:typeof window<"u"?window.location.pathname:null}}function Jb(r){return t=>({event_name:t.eventName,properties:t.properties,timestamp:t.timestamp,page_url:t.pageUrl,...r})}let oc=null;async function Zb(r){if(!Me.sessionContext){if(!oc){const t=md();oc=r.me().then(s=>({user_id:s.id,session_id:t})).catch(()=>({user_id:null,session_id:t}))}Me.sessionContext=await oc}return Me.sessionContext}function ek(){if(typeof window>"u"||!window.location)return;const t=new URLSearchParams(window.location.search).get(Em);if(t==null||!t.length)return;const s=new URLSearchParams(window.location.search);s.delete(Em);const o=window.location.pathname+(s.toString()?"?"+s.toString():"");return window.history.replaceState({},"",o),{enabled:t==="true"}}function md(){if(typeof window>"u")return rc();try{const r=localStorage.getItem(Sm);if(!r){const t=rc();return localStorage.setItem(Sm,t),t}return r}catch{return rc()}}class tk extends Error{constructor(t,s,o,a,u){super(t),this.name="Base44Error",this.status=s,this.code=o,this.data=a,this.originalError=u}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code,data:this.data}}}function Bo({baseURL:r,headers:t={},token:s,interceptResponses:o=!0,onError:a}){const u=Ke.create({baseURL:r,headers:{"Content-Type":"application/json",Accept:"application/json",...t}});return s&&(u.defaults.headers.common.Authorization=`Bearer ${s}`),u.interceptors.request.use(d=>{typeof window<"u"&&window.location&&(d.headers.set("X-Origin-URL",window.location.href),d.headers.get("Authorization")||d.headers.set("X-Base44-Anonymous-Id",md()));const h=zb();if(d.requestId=h,wm)try{window.parent.postMessage({type:"api-request-start",requestId:h,data:{url:r+d.url,method:d.method,body:d.data instanceof FormData?"[FormData object]":d.data}},"*")}catch{}return d}),o&&u.interceptors.response.use(d=>{var h;const p=(h=d.config)===null||h===void 0?void 0:h.requestId;try{wm&&p&&window.parent.postMessage({type:"api-request-end",requestId:p,data:{statusCode:d.status,response:d.data}},"*")}catch{}return d.data},d=>{var h,p,m,y,v,k,L,F;const b=((p=(h=d.response)===null||h===void 0?void 0:h.data)===null||p===void 0?void 0:p.message)||((y=(m=d.response)===null||m===void 0?void 0:m.data)===null||y===void 0?void 0:y.detail)||d.message,x=new tk(b,(v=d.response)===null||v===void 0?void 0:v.status,(L=(k=d.response)===null||k===void 0?void 0:k.data)===null||L===void 0?void 0:L.code,(F=d.response)===null||F===void 0?void 0:F.data,d);return a==null||a(x),Promise.reject(x)}),u}function Cm(r){const{axios:t,appId:s,getSocket:o}=r;return new Proxy({},{get(a,u){if(!(typeof u!="string"||u==="then"||u.startsWith("_")))return rk(t,s,u,o)}})}function nk(r){var t;try{const s=JSON.parse(r);return{type:s.type,data:s.data,id:s.id||((t=s.data)===null||t===void 0?void 0:t.id),timestamp:s.timestamp||new Date().toISOString()}}catch(s){return console.warn("[Base44 SDK] Failed to parse realtime message:",s),null}}function rk(r,t,s,o){const a=`/apps/${t}/entities/${s}`;return{async list(u,d,h,p){const m={};return u&&(m.sort=u),d&&(m.limit=d),h&&(m.skip=h),p&&(m.fields=Array.isArray(p)?p.join(","):p),r.get(a,{params:m})},async filter(u,d,h,p,m){const y={q:JSON.stringify(u)};return d&&(y.sort=d),h&&(y.limit=h),p&&(y.skip=p),m&&(y.fields=Array.isArray(m)?m.join(","):m),r.get(a,{params:y})},async get(u){return r.get(`${a}/${u}`)},async create(u){return r.post(a,u)},async update(u,d){return r.put(`${a}/${u}`,d)},async delete(u){return r.delete(`${a}/${u}`)},async deleteMany(u){return r.delete(a,{data:u})},async bulkCreate(u){return r.post(`${a}/bulk`,u)},async updateMany(u,d){return r.patch(`${a}/update-many`,{query:u,data:d})},async bulkUpdate(u){return r.put(`${a}/bulk`,u)},async importEntities(u){const d=new FormData;return d.append("file",u,u.name),r.post(`${a}/import`,d,{headers:{"Content-Type":"multipart/form-data"}})},subscribe(u){const d=`entities:${t}:${s}`;return o().subscribeToRoom(d,{update_model:m=>{var y;const v=nk(m.data);if(v){v.type!=="delete"&&(!((y=v.data)===null||y===void 0)&&y._oversize)&&console.error(`[Base44 SDK] Realtime broadcast for ${s}#${v.id} was oversize and got slimmed for transport. Fields >10 KB are empty and the rest of the record may be a stub. Call \`entities.${s}.get("${v.id}")\` to fetch the full record.`);try{u(v)}catch(k){console.error("[Base44 SDK] Subscription callback error:",k)}}}})}}}function sk(r,t){return{async call(s,o,a){if(!(s!=null&&s.trim()))throw new Error("Integration slug is required and cannot be empty");if(!(o!=null&&o.trim()))throw new Error("Operation ID is required and cannot be empty");const{pathParams:u,queryParams:d,...h}=a??{},p={...h,...u&&{path_params:u},...d&&{query_params:d}};return await r.post(`/apps/${t}/integrations/custom/${s}/${o}`,p)}}}function Rm(r,t){const s=sk(r,t);return new Proxy({},{get(o,a){if(!(typeof a!="string"||a==="then"||a.startsWith("_")))return a==="custom"?s:new Proxy({},{get(u,d){if(!(typeof d!="string"||d==="then"||d.startsWith("_")))return async h=>{if(typeof h=="string")throw new Error(`Integration ${d} must receive an object with named parameters, received: ${h}`);let p,m;return h instanceof FormData||h&&Object.values(h).some(y=>y instanceof File)?(p=new FormData,Object.keys(h).forEach(y=>{h[y]instanceof File?p.append(y,h[y],h[y].name):typeof h[y]=="object"&&h[y]!==null?p.append(y,JSON.stringify(h[y])):p.append(y,h[y])}),m="multipart/form-data"):(p=h,m="application/json"),a==="Core"?r.post(`/apps/${t}/integration-endpoints/Core/${d}`,p||h,{headers:{"Content-Type":m}}):r.post(`/apps/${t}/integration-endpoints/installable/${a}/integration-endpoints/${d}`,p||h,{headers:{"Content-Type":m}})}}})}})}function ok(){return typeof window>"u"?!1:window!==window.parent}function ik(r,t,s){const u=Math.round(window.screenX+(window.outerWidth-500)/2),d=Math.round(window.screenY+(window.outerHeight-600)/2),h=window.open(r,"base44_auth",`width=500,height=600,left=${u},top=${d},resizable=yes,scrollbars=yes`);if(!h)return;const p=()=>{window.removeEventListener("message",m),clearInterval(y),h.closed||h.close()},m=v=>{var k;if(v.origin!==s||v.source!==h||!(!((k=v.data)===null||k===void 0)&&k.access_token))return;p();const L=new URL(t),{access_token:F,is_new_user:b}=v.data;L.searchParams.set("access_token",F),b!=null&&L.searchParams.set("is_new_user",String(b)),window.location.href=L.toString()},y=setInterval(()=>{h.closed&&p()},500);window.addEventListener("message",m)}function ak(r,t,s,o){return{async me(){return r.get(`/apps/${s}/entities/User/me`)},async updateMe(a){return r.put(`/apps/${s}/entities/User/me`,a)},redirectToLogin(a){if(typeof window>"u")throw new Error("Login method can only be used in a browser environment");const u=a?new URL(a,window.location.origin).toString():window.location.href,d=`${o.appBaseUrl}/login?from_url=${encodeURIComponent(u)}`;window.location.href=d},loginWithProvider(a,u="/"){const d=new URL(u,window.location.origin).toString(),h=`app_id=${s}&from_url=${encodeURIComponent(d)}`;let p;a==="sso"?p=`/apps/${s}/auth/sso/login`:p=`/apps/auth${a==="google"?"":`/${a}`}/login`;const m=`${o.appBaseUrl}/api${p}?${h}`;if(ok()){const y=`${m}&popup_origin=${encodeURIComponent(window.location.origin)}`;return ik(y,d,window.location.origin)}window.location.href=m},logout(a){if(delete r.defaults.headers.common.Authorization,typeof window<"u"){if(window.localStorage)try{window.localStorage.removeItem("base44_access_token"),window.localStorage.removeItem("token")}catch(h){console.error("Failed to remove token from localStorage:",h)}const u=a||window.location.href,d=`${o.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(u)}`;window.location.href=d}},setToken(a,u=!0){if(a&&(r.defaults.headers.common.Authorization=`Bearer ${a}`,t.defaults.headers.common.Authorization=`Bearer ${a}`,u&&typeof window<"u"&&window.localStorage))try{window.localStorage.setItem("base44_access_token",a),window.localStorage.setItem("token",a)}catch(d){console.error("Failed to save token to localStorage:",d)}},async loginViaEmailPassword(a,u,d){var h;try{const p=await r.post(`/apps/${s}/auth/login`,{email:a,password:u,...d&&{turnstile_token:d}}),{access_token:m,user:y}=p;return m&&this.setToken(m),{access_token:m,user:y}}catch(p){throw((h=p.response)===null||h===void 0?void 0:h.status)===401&&await this.logout(),p}},async isAuthenticated(){try{return await this.me(),!0}catch{return!1}},inviteUser(a,u){return r.post(`/apps/${s}/users/invite-user`,{user_email:a,role:u})},register(a){return r.post(`/apps/${s}/auth/register`,a)},verifyOtp({email:a,otpCode:u}){return r.post(`/apps/${s}/auth/verify-otp`,{email:a,otp_code:u})},resendOtp(a){return r.post(`/apps/${s}/auth/resend-otp`,{email:a})},resetPasswordRequest(a){return r.post(`/apps/${s}/auth/reset-password-request`,{email:a})},resetPassword({resetToken:a,newPassword:u}){return r.post(`/apps/${s}/auth/reset-password`,{reset_token:a,new_password:u})},changePassword({userId:a,currentPassword:u,newPassword:d}){return r.post(`/apps/${s}/auth/change-password`,{user_id:a,current_password:u,new_password:d})}}}function lk(r,t){return{async getAccessToken(s){const o=`/apps/${t}/auth/sso/accesstoken/${s}`;return r.get(o)},async getIdToken(s){const o=`/apps/${t}/auth/sso/idtoken/${s}`;return r.get(o)}}}function uk(r,t){return{async getAccessToken(s){if(!s||typeof s!="string")throw new Error("Integration type is required and must be a string");return(await r.get(`/apps/${t}/external-auth/tokens/${s}`)).access_token},async getConnection(s){var o;if(!s||typeof s!="string")throw new Error("Integration type is required and must be a string");const u=await r.get(`/apps/${t}/external-auth/tokens/${s}`);return{accessToken:u.access_token,connectionConfig:(o=u.connection_config)!==null&&o!==void 0?o:null}},async getWorkspaceConnection(s){var o;if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");const u=await r.get(`/apps/${t}/external-auth/tokens/connectors/${s}`);return{accessToken:u.access_token,connectionConfig:(o=u.connection_config)!==null&&o!==void 0?o:null}},async getCurrentAppUserAccessToken(s){if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");return(await r.get(`/apps/${t}/app-user-auth/connectors/${s}/token`)).access_token},async getCurrentAppUserConnection(s){var o;if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");const u=await r.get(`/apps/${t}/app-user-auth/connectors/${s}/token`);return{accessToken:u.access_token,connectionConfig:(o=u.connection_config)!==null&&o!==void 0?o:null}}}}function ck(r,t){return{async connectAppUser(s){if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");return(await r.post(`/apps/${t}/app-user-auth/connectors/${s}/initiate`)).redirect_url},async disconnectAppUser(s){if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");await r.delete(`/apps/${t}/app-user-auth/connectors/${s}`)}}}function Gr(r={}){const{storageKey:t="base44_access_token",paramName:s="access_token",saveToStorage:o=!0,removeFromUrl:a=!0}=r;let u=null;if(typeof window<"u"&&window.location)try{const d=new URLSearchParams(window.location.search);if(u=d.get(s),u){if(o&&dk(u,{storageKey:t}),a){d.delete(s);const h=`${window.location.pathname}${d.toString()?`?${d.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,h)}return u}}catch(d){console.error("Error retrieving token from URL:",d)}if(typeof window<"u"&&window.localStorage)try{return u=window.localStorage.getItem(t),u}catch(d){console.error("Error retrieving token from local storage:",d)}return null}function dk(r,t){const{storageKey:s="base44_access_token"}=t;if(typeof window>"u"||!window.localStorage||!r)return!1;try{return window.localStorage.setItem(s,r),window.localStorage.setItem("token",r),!0}catch(o){return console.error("Error saving token to local storage:",o),!1}}function Tm(r,t,s){const o=(u,d)=>u?`${String(u).replace(/\/$/,"")}${d}`:d,a=u=>{const d=new Headers;if(s!=null&&s.getAuthHeaders){const h=s.getAuthHeaders();Object.entries(h).forEach(([p,m])=>{m!=null&&d.set(p,String(m))})}return u&&new Headers(u).forEach((h,p)=>{d.set(p,h)}),d};return{async invoke(u,d){if(typeof d=="string")throw new Error(`Function ${u} must receive an object with named parameters, received: ${d}`);let h,p;return d instanceof FormData||d&&Object.values(d).some(m=>m instanceof File)?(h=new FormData,Object.keys(d).forEach(m=>{d[m]instanceof File?h.append(m,d[m],d[m].name):typeof d[m]=="object"&&d[m]!==null?h.append(m,JSON.stringify(d[m])):h.append(m,d[m])}),p="multipart/form-data"):(h=d,p="application/json"),r.post(`/apps/${t}/functions/${u}`,h||d,{headers:{"Content-Type":p}})},async fetch(u,d={}){const p=`/functions${u.startsWith("/")?u:`/${u}`}`,m=a(d.headers),y={...d,headers:m};return await fetch(o(s==null?void 0:s.baseURL,p),y)}}}function Pm({axios:r,getSocket:t,appId:s,serverUrl:o,token:a}){const u=`/apps/${s}/agents`,d={},h=()=>r.get(`${u}/conversations`),p=b=>r.get(`${u}/conversations/${b}`);return{getConversations:h,getConversation:p,listConversations:b=>r.get(`${u}/conversations`,{params:b}),createConversation:b=>r.post(`${u}/conversations`,b),addMessage:async(b,x)=>r.post(`${u}/conversations/v2/${b.id}/messages`,x),subscribeToConversation:(b,x)=>{const S=`/agent-conversations/${b}`,I=t(),P=p(b).then(A=>(d[b]=A,A));return I.subscribeToRoom(S,{connect:()=>{},update_model:async({data:A})=>{const V=JSON.parse(A);if(V._message){await P;const $=V._message,G=d[b];if(G){const B=G.messages||[],ie=B.findIndex(Ee=>Ee.id===$.id),ue=ie!==-1?B.map((Ee,Te)=>Te===ie?$:Ee):[...B,$];d[b]={...G,messages:ue},x==null||x(d[b])}}}})},getWhatsAppConnectURL:b=>{const x=`${o}/api/apps/${s}/agents/${encodeURIComponent(b)}/whatsapp`,S=a??Gr();return S?`${x}?token=${S}`:x},getTelegramConnectURL:b=>{const x=`${o}/api/apps/${s}/agents/${encodeURIComponent(b)}/telegram`,S=a??Gr();return S?`${x}?token=${S}`:x}}}function Nm({serverUrl:r,token:t,appId:s}){return{connection:()=>{var a;return{baseURL:`${r}/api/apps/${s}/ai/openai/v1`,token:(a=t??Gr())!==null&&a!==void 0?a:""}}}}function Om(r,t){const s=`/app-logs/${t}`;return{async logUserInApp(o){await r.post(`${s}/log-user-in-app/${o}`)},async fetchLogs(o={}){return await r.get(s,{params:o})},async getStats(o={}){return await r.get(`${s}/stats`,{params:o})}}}function fk(r,t){return{async inviteUser(s,o){if(o!=="user"&&o!=="admin")throw new Error(`Invalid role: "${o}". Role must be either "user" or "admin".`);return await r.post(`/apps/${t}/runtime/users/invite-user`,{user_email:s,role:o})}}}const xn=Object.create(null);xn.open="0";xn.close="1";xn.ping="2";xn.pong="3";xn.message="4";xn.upgrade="5";xn.noop="6";const Ma=Object.create(null);Object.keys(xn).forEach(r=>{Ma[xn[r]]=r});const Fc={type:"error",data:"parser error"},Gy=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Xy=typeof ArrayBuffer=="function",Yy=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,gd=({type:r,data:t},s,o)=>Gy&&t instanceof Blob?s?o(t):Am(t,o):Xy&&(t instanceof ArrayBuffer||Yy(t))?s?o(t):Am(new Blob([t]),o):o(xn[r]+(t||"")),Am=(r,t)=>{const s=new FileReader;return s.onload=function(){const o=s.result.split(",")[1];t("b"+(o||""))},s.readAsDataURL(r)};function Lm(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let ic;function hk(r,t){if(Gy&&r.data instanceof Blob)return r.data.arrayBuffer().then(Lm).then(t);if(Xy&&(r.data instanceof ArrayBuffer||Yy(r.data)))return t(Lm(r.data));gd(r,!1,s=>{ic||(ic=new TextEncoder),t(ic.encode(s))})}const Im="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$o=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r{let t=r.length*.75,s=r.length,o,a=0,u,d,h,p;r[r.length-1]==="="&&(t--,r[r.length-2]==="="&&t--);const m=new ArrayBuffer(t),y=new Uint8Array(m);for(o=0;o>4,y[a++]=(d&15)<<4|h>>2,y[a++]=(h&3)<<6|p&63;return m},mk=typeof ArrayBuffer=="function",yd=(r,t)=>{if(typeof r!="string")return{type:"message",data:Jy(r,t)};const s=r.charAt(0);return s==="b"?{type:"message",data:gk(r.substring(1),t)}:Ma[s]?r.length>1?{type:Ma[s],data:r.substring(1)}:{type:Ma[s]}:Fc},gk=(r,t)=>{if(mk){const s=pk(r);return Jy(s,t)}else return{base64:!0,data:r}},Jy=(r,t)=>{switch(t){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}},Zy="",yk=(r,t)=>{const s=r.length,o=new Array(s);let a=0;r.forEach((u,d)=>{gd(u,!1,h=>{o[d]=h,++a===s&&t(o.join(Zy))})})},vk=(r,t)=>{const s=r.split(Zy),o=[];for(let a=0;a{const o=s.length;let a;if(o<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,o);else if(o<65536){a=new Uint8Array(3);const u=new DataView(a.buffer);u.setUint8(0,126),u.setUint16(1,o)}else{a=new Uint8Array(9);const u=new DataView(a.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(o))}r.data&&typeof r.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(s)})}})}let ac;function Ta(r){return r.reduce((t,s)=>t+s.length,0)}function Pa(r,t){if(r[0].length===t)return r.shift();const s=new Uint8Array(t);let o=0;for(let a=0;aMath.pow(2,21)-1){h.enqueue(Fc);break}a=y*Math.pow(2,32)+m.getUint32(4),o=3}else{if(Ta(s)r){h.enqueue(Fc);break}}}})}const ev=4;function Xe(r){if(r)return Ek(r)}function Ek(r){for(var t in Xe.prototype)r[t]=Xe.prototype[t];return r}Xe.prototype.on=Xe.prototype.addEventListener=function(r,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(t),this};Xe.prototype.once=function(r,t){function s(){this.off(r,s),t.apply(this,arguments)}return s.fn=t,this.on(r,s),this};Xe.prototype.off=Xe.prototype.removeListener=Xe.prototype.removeAllListeners=Xe.prototype.removeEventListener=function(r,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+r];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var o,a=0;aPromise.resolve().then(t):(t,s)=>s(t,0),Gt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Sk="arraybuffer";function tv(r,...t){return t.reduce((s,o)=>(r.hasOwnProperty(o)&&(s[o]=r[o]),s),{})}const _k=Gt.setTimeout,bk=Gt.clearTimeout;function Ja(r,t){t.useNativeTimers?(r.setTimeoutFn=_k.bind(Gt),r.clearTimeoutFn=bk.bind(Gt)):(r.setTimeoutFn=Gt.setTimeout.bind(Gt),r.clearTimeoutFn=Gt.clearTimeout.bind(Gt))}const kk=1.33;function Ck(r){return typeof r=="string"?Rk(r):Math.ceil((r.byteLength||r.size)*kk)}function Rk(r){let t=0,s=0;for(let o=0,a=r.length;o=57344?s+=3:(o++,s+=4);return s}function nv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Tk(r){let t="";for(let s in r)r.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(r[s]));return t}function Pk(r){let t={},s=r.split("&");for(let o=0,a=s.length;o{this.readyState="paused",t()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||s()})),this.writable||(o++,this.once("drain",function(){--o||s()}))}else s()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const s=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};vk(t,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,yk(t,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=nv()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(t,s)}}let rv=!1;try{rv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ak=rv;function Lk(){}class Ik extends Ok{constructor(t){if(super(t),typeof location<"u"){const s=location.protocol==="https:";let o=location.port;o||(o=s?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||o!==t.port}}doWrite(t,s){const o=this.request({method:"POST",data:t});o.on("success",s),o.on("error",(a,u)=>{this.onError("xhr post error",a,u)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(s,o)=>{this.onError("xhr poll error",s,o)}),this.pollXhr=t}}class wn extends Xe{constructor(t,s,o){super(),this.createRequest=t,Ja(this,o),this._opts=o,this._method=o.method||"GET",this._uri=s,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var t;const s=tv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(s);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&o.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var a;o.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=wn.requestsCount++,wn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Lk,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete wn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}wn.requestsCount=0;wn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jm);else if(typeof addEventListener=="function"){const r="onpagehide"in Gt?"pagehide":"unload";addEventListener(r,jm,!1)}}function jm(){for(let r in wn.requests)wn.requests.hasOwnProperty(r)&&wn.requests[r].abort()}const jk=(function(){const r=sv({xdomain:!1});return r&&r.responseType!==null})();class Dk extends Ik{constructor(t){super(t);const s=t&&t.forceBase64;this.supportsBinary=jk&&!s}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new wn(sv,this.uri(),t)}}function sv(r){const t=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ak))return new XMLHttpRequest}catch{}if(!t)try{return new Gt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ov=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Mk extends vd{get name(){return"websocket"}doOpen(){const t=this.uri(),s=this.opts.protocols,o=ov?{}:tv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,s,o)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let s=0;s{try{this.doWrite(o,u)}catch{}a&&Ya(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=nv()),this.supportsBinary||(s.b64=1),this.createUri(t,s)}}const lc=Gt.WebSocket||Gt.MozWebSocket;class Fk extends Mk{createSocket(t,s,o){return ov?new lc(t,s,o):s?new lc(t,s):new lc(t)}doWrite(t,s){this.ws.send(s)}}class Uk extends vd{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const s=xk(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=t.readable.pipeThrough(s).getReader(),a=wk();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const u=()=>{o.read().then(({done:h,value:p})=>{h||(this.onPacket(p),u())}).catch(h=>{})};u();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let s=0;s{a&&Ya(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const zk={websocket:Fk,webtransport:Uk,polling:Dk},Bk=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$k=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Uc(r){if(r.length>8e3)throw"URI too long";const t=r,s=r.indexOf("["),o=r.indexOf("]");s!=-1&&o!=-1&&(r=r.substring(0,s)+r.substring(s,o).replace(/:/g,";")+r.substring(o,r.length));let a=Bk.exec(r||""),u={},d=14;for(;d--;)u[$k[d]]=a[d]||"";return s!=-1&&o!=-1&&(u.source=t,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=Vk(u,u.path),u.queryKey=Hk(u,u.query),u}function Vk(r,t){const s=/\/{2,9}/g,o=t.replace(s,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&o.splice(0,1),t.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Hk(r,t){const s={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,a,u){a&&(s[a]=u)}),s}const zc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fa=[];zc&&addEventListener("offline",()=>{Fa.forEach(r=>r())},!1);class wr extends Xe{constructor(t,s){if(super(),this.binaryType=Sk,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){const o=Uc(t);s.hostname=o.host,s.secure=o.protocol==="https"||o.protocol==="wss",s.port=o.port,o.query&&(s.query=o.query)}else s.host&&(s.hostname=Uc(s.host).host);Ja(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(o=>{const a=o.prototype.name;this.transports.push(a),this._transportsByName[a]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Pk(this.opts.query)),zc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fa.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const s=Object.assign({},this.opts.query);s.EIO=ev,s.transport=t,this.id&&(s.sid=this.id);const o=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&wr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",wr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let o=0;o0&&s>this._maxPayload)return this.writeBuffer.slice(0,o);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ya(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,o){return this._sendPacket("message",t,s,o),this}send(t,s,o){return this._sendPacket("message",t,s,o),this}_sendPacket(t,s,o,a){if(typeof s=="function"&&(a=s,s=void 0),typeof o=="function"&&(a=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const u={type:t,data:s,options:o};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},o=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():t()}):this.upgrading?o():t()),this}_onError(t){if(wr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),zc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=Fa.indexOf(this._offlineEventListener);o!==-1&&Fa.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}wr.protocol=ev;class Wk extends wr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{o||(s.send([{type:"ping",data:"probe"}]),s.once("packet",v=>{if(!o)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;wr.priorWebsocketSuccess=s.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(y(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{const k=new Error("probe error");k.transport=s.name,this.emitReserved("upgradeError",k)}}))};function u(){o||(o=!0,y(),s.close(),s=null)}const d=v=>{const k=new Error("probe error: "+v);k.transport=s.name,u(),this.emitReserved("upgradeError",k)};function h(){d("transport closed")}function p(){d("socket closed")}function m(v){s&&v.name!==s.name&&u()}const y=()=>{s.removeListener("open",a),s.removeListener("error",d),s.removeListener("close",h),this.off("close",p),this.off("upgrading",m)};s.once("open",a),s.once("error",d),s.once("close",h),this.once("close",p),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{o||s.open()},200):s.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const s=[];for(let o=0;ozk[u]).filter(u=>!!u)),super(o?a:t,a)}};function Qk(r,t="",s){let o=r;s=s||typeof location<"u"&&location,r==null&&(r=s.protocol+"//"+s.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=s.protocol+r:r=s.host+r),/^(https?|wss?):\/\//.test(r)||(typeof s<"u"?r=s.protocol+"//"+r:r="https://"+r),o=Uc(r)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const u=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+u+":"+o.port+t,o.href=o.protocol+"://"+u+(s&&s.port===o.port?"":":"+o.port),o}const Kk=typeof ArrayBuffer=="function",Gk=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,iv=Object.prototype.toString,Xk=typeof Blob=="function"||typeof Blob<"u"&&iv.call(Blob)==="[object BlobConstructor]",Yk=typeof File=="function"||typeof File<"u"&&iv.call(File)==="[object FileConstructor]";function wd(r){return Kk&&(r instanceof ArrayBuffer||Gk(r))||Xk&&r instanceof Blob||Yk&&r instanceof File}function Ua(r,t){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let s=0,o=r.length;s=0&&r.numthis.opts.maxAttachments)throw new Error("too many attachments");o.attachments=h}if(t.charAt(s+1)==="/"){const u=s+1;for(;++s&&!(t.charAt(s)===","||s===t.length););o.nsp=t.substring(u,s)}else o.nsp="/";const a=t.charAt(s+1);if(a!==""&&Number(a)==a){const u=s+1;for(;++s;){const d=t.charAt(s);if(d==null||Number(d)!=d){--s;break}if(s===t.length)break}o.id=Number(t.substring(u,s+1))}if(t.charAt(++s)){const u=this.tryParse(t.substr(s));if(xd.isPayloadValid(o.type,u))o.data=u;else throw new Error("invalid payload")}return o}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,s){switch(t){case Oe.CONNECT:return Dm(s);case Oe.DISCONNECT:return s===void 0;case Oe.CONNECT_ERROR:return typeof s=="string"||Dm(s);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&eC.indexOf(s[0])===-1);case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class nC{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const s=Zk(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const rC=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function Dm(r){return Object.prototype.toString.call(r)==="[object Object]"}const sC=Object.freeze(Object.defineProperty({__proto__:null,Decoder:xd,Encoder:tC,get PacketType(){return Oe}},Symbol.toStringTag,{value:"Module"}));function un(r,t,s){return r.on(t,s),function(){r.off(t,s)}}const oC=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class av extends Xe{constructor(t,s,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=s,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[un(t,"open",this.onopen.bind(this)),un(t,"packet",this.onpacket.bind(this)),un(t,"error",this.onerror.bind(this)),un(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...s){var o,a,u;if(oC.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(s.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;const d={type:Oe.EVENT,data:s};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){const y=this.ids++,v=s.pop();this._registerAckCallback(y,v),d.id=y}const h=(a=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||a===void 0?void 0:a.writable,p=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!h||(p?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(t,s){var o;const a=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(a===void 0){this.acks[t]=s;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let h=0;h{this.io.clearTimeoutFn(u),s.apply(this,h)};d.withError=!0,this.acks[t]=d}emitWithAck(t,...s){return new Promise((o,a)=>{const u=(d,h)=>d?a(d):o(h);u.withError=!0,s.push(u),this.emit(t,...s)})}_addToQueue(t){let s;typeof t[t.length-1]=="function"&&(s=t.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...u)=>(this._queue[0],a!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),s&&s(a)):(this._queue.shift(),s&&s(null,...u)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const s=this._queue[0];s.pending&&!t||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(o=>String(o.id)===t)){const o=this.acks[t];delete this.acks[t],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Oe.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(t);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(t);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const o=new Error(t.data.message);o.data=t.data.data,this.emitReserved("connect_error",o);break}}onevent(t){const s=t.data||[];t.id!=null&&s.push(this.ack(t.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const s=this._anyListeners.slice();for(const o of s)o.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const s=this;let o=!1;return function(...a){o||(o=!0,s.packet({type:Oe.ACK,id:t,data:a}))}}onack(t){const s=this.acks[t.id];typeof s=="function"&&(delete this.acks[t.id],s.withError&&t.data.unshift(null),s.apply(this,t.data))}onconnect(t,s){this.id=t,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const s=this._anyListeners;for(let o=0;o0&&r.jitter<=1?r.jitter:0,this.attempts=0}Gs.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*r);r=(Math.floor(t*10)&1)==0?r-s:r+s}return Math.min(r,this.max)|0};Gs.prototype.reset=function(){this.attempts=0};Gs.prototype.setMin=function(r){this.ms=r};Gs.prototype.setMax=function(r){this.max=r};Gs.prototype.setJitter=function(r){this.jitter=r};class Vc extends Xe{constructor(t,s){var o;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(s=t,t=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,Ja(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((o=s.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new Gs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=t;const a=s.parser||sC;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var s;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(s=this.backoff)===null||s===void 0||s.setMin(t),this)}randomizationFactor(t){var s;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(s=this.backoff)===null||s===void 0||s.setJitter(t),this)}reconnectionDelayMax(t){var s;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(s=this.backoff)===null||s===void 0||s.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new qk(this.uri,this.opts);const s=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const a=un(s,"open",function(){o.onopen(),t&&t()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),t?t(h):this.maybeReconnectOnOpen()},d=un(s,"error",u);if(this._timeout!==!1){const h=this._timeout,p=this.setTimeoutFn(()=>{a(),u(new Error("timeout")),s.close()},h);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(a),this.subs.push(d),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(un(t,"ping",this.onping.bind(this)),un(t,"data",this.ondata.bind(this)),un(t,"error",this.onerror.bind(this)),un(t,"close",this.onclose.bind(this)),un(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(s){this.onclose("parse error",s)}}ondecoded(t){Ya(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,s){let o=this.nsps[t];return o?this._autoConnect&&!o.active&&o.connect():(o=new av(this,t,s),this.nsps[t]=o),o}_destroy(t){const s=Object.keys(this.nsps);for(const o of s)if(this.nsps[o].active)return;this._close()}_packet(t){const s=this.encoder.encode(t);for(let o=0;ot()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,s){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const s=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},s);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Uo={};function za(r,t){typeof r=="object"&&(t=r,r=void 0),t=t||{};const s=Qk(r,t.path||"/socket.io"),o=s.source,a=s.id,u=s.path,d=Uo[a]&&u in Uo[a].nsps,h=t.forceNew||t["force new connection"]||t.multiplex===!1||d;let p;return h?p=new Vc(o,t):(Uo[a]||(Uo[a]=new Vc(o,t)),p=Uo[a]),s.query&&!t.query&&(t.query=s.queryKey),p.socket(s.path,t)}Object.assign(za,{Manager:Vc,Socket:av,io:za,connect:za});const iC=250;function Mm(r,t){var s;const o=(s=r.token)!==null&&s!==void 0?s:Gr(),a={app_id:r.appId,token:o};o||(a.anonymous_id=md());const u=za(r.serverUrl,{path:r.mountPath,transports:r.transports,query:a});return u.on("connect",async()=>{var d;return console.log("connect",u.id),(d=t.connect)===null||d===void 0?void 0:d.call(t)}),u.on("update_model",async d=>{var h;return(h=t.update_model)===null||h===void 0?void 0:h.call(t,d)}),u.on("error",async d=>{var h;return(h=t.error)===null||h===void 0?void 0:h.call(t,d)}),u.on("connect_error",async d=>{var h;return console.error("connect_error",d),(h=t.error)===null||h===void 0?void 0:h.call(t,d)}),u}function aC({config:r}){let t={...r};const s={},o={},a={connect:async()=>{const S=[];Object.keys(s).forEach(I=>{const P=k(I);P.length!==0&&(m(I),P.forEach(({connect:A})=>{const V=async()=>A==null?void 0:A();S.push(V())}))}),await Promise.all(S)},update_model:async S=>{const P=k(S.room).map(A=>{var V;return(V=A.update_model)===null||V===void 0?void 0:V.call(A,S)});await Promise.all(P)},error:async S=>{console.error("error",S);const I=Object.values(s).flat().map(P=>{var A;return(A=P.error)===null||A===void 0?void 0:A.call(P,S)});await Promise.all(I)}};let u=Mm(r,a);function d(){h()}function h(){F(),u&&u.disconnect()}function p(S){d(),t={...t,...S},u=Mm(t,a)}function m(S){u.emit("join",S)}function y(S){u.emit("leave",S)}async function v(S,I){var P;const A=JSON.stringify(I);return(P=a.update_model)===null||P===void 0?void 0:P.call(a,{room:S,data:A})}function k(S){var I;return(I=s[S])!==null&&I!==void 0?I:[]}function L(S){const I=o[S];I&&(clearTimeout(I),delete o[S])}function F(){Object.keys(o).forEach(S=>{var I,P;clearTimeout(o[S]),delete o[S],((P=(I=s[S])===null||I===void 0?void 0:I.length)!==null&&P!==void 0?P:0)===0&&delete s[S]})}function b(S){L(S),o[S]=setTimeout(()=>{var I,P;delete o[S],!(((P=(I=s[S])===null||I===void 0?void 0:I.length)!==null&&P!==void 0?P:0)>0)&&(y(S),delete s[S])},iC)}return{socket:u,subscribeToRoom:(S,I)=>{s[S]?L(S):(m(S),s[S]=[]),s[S].push(I);let P=!1;return()=>{var A,V;P||(P=!0,s[S]=(V=(A=s[S])===null||A===void 0?void 0:A.filter($=>$!==I))!==null&&V!==void 0?V:[],s[S].length===0&&b(S))}},updateConfig:p,updateModel:v,disconnect:h}}(!globalThis.EventTarget||!globalThis.Event)&&console.error(` PartySocket requires a global 'EventTarget' class to be available! You can polyfill this global by adding this to your code before any partysocket imports: \`\`\` import 'partysocket/event-target-polyfill'; \`\`\` Please file an issue at https://github.com/partykit/partykit if you're still having trouble. `);var lv=class extends Event{constructor(t,s){super("error",s);Ie(this,"message");Ie(this,"error");this.message=t.message,this.error=t}},uv=class extends Event{constructor(t=1e3,s="",o){super("close",o);Ie(this,"code");Ie(this,"reason");Ie(this,"wasClean",!0);this.code=t,this.reason=s}},uc={Event,ErrorEvent:lv,CloseEvent:uv};function lC(r,t){if(!r)throw new Error(t)}function uC(r){return new r.constructor(r.type,r)}function cC(r){return"data"in r?new MessageEvent(r.type,r):"code"in r||"reason"in r?new uv(r.code||1999,r.reason||"unknown reason",r):"error"in r?new lv(r.error,r):new Event(r.type,r)}var eg,dC=typeof process<"u"&&typeof((eg=process.versions)==null?void 0:eg.node)<"u"&&typeof document>"u",Na=dC?cC:uC,jr={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0},Fm=!1,fC=class Dr extends EventTarget{constructor(s,o,a={}){super();Ie(this,"_ws");Ie(this,"_retryCount",-1);Ie(this,"_uptimeTimeout");Ie(this,"_connectTimeout");Ie(this,"_shouldReconnect",!0);Ie(this,"_connectLock",!1);Ie(this,"_binaryType","blob");Ie(this,"_closeCalled",!1);Ie(this,"_messageQueue",[]);Ie(this,"_url");Ie(this,"_protocols");Ie(this,"_options");Ie(this,"onclose",null);Ie(this,"onerror",null);Ie(this,"onmessage",null);Ie(this,"onopen",null);Ie(this,"_handleOpen",s=>{this._debug("open event");const{minUptime:o=jr.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),o),lC(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(a=>{var u;return(u=this._ws)==null?void 0:u.send(a)}),this._messageQueue=[],this.onopen&&this.onopen(s),this.dispatchEvent(Na(s))});Ie(this,"_handleMessage",s=>{this._debug("message event"),this.onmessage&&this.onmessage(s),this.dispatchEvent(Na(s))});Ie(this,"_handleError",s=>{this._debug("error event",s.message),this._disconnect(void 0,s.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(s),this._debug("exec error listeners"),this.dispatchEvent(Na(s)),this._connect()});Ie(this,"_handleClose",s=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(s),this.dispatchEvent(Na(s))});this._url=s,this._protocols=o,this._options=a,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Dr.CONNECTING}get OPEN(){return Dr.OPEN}get CLOSING(){return Dr.CLOSING}get CLOSED(){return Dr.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(s){this._binaryType=s,this._ws&&(this._ws.binaryType=s)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((o,a)=>(typeof a=="string"?o+=a.length:a instanceof Blob?o+=a.size:o+=a.byteLength,o),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Dr.CLOSED:Dr.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(s=1e3,o){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(s,o)}reconnect(s,o){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(s,o),this._connect())}send(s){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",s),this._ws.send(s);else{const{maxEnqueuedMessages:o=jr.maxEnqueuedMessages}=this._options;this._messageQueue.length",...s])}_getNextDelay(){const{reconnectionDelayGrowFactor:s=jr.reconnectionDelayGrowFactor,minReconnectionDelay:o=jr.minReconnectionDelay,maxReconnectionDelay:a=jr.maxReconnectionDelay}=this._options;let u=0;return this._retryCount>0&&(u=o*Math.pow(s,this._retryCount-1),u>a&&(u=a)),this._debug("next delay",u),u}_wait(){return new Promise(s=>{setTimeout(s,this._getNextDelay())})}_getNextProtocols(s){if(!s)return Promise.resolve(null);if(typeof s=="string"||Array.isArray(s))return Promise.resolve(s);if(typeof s=="function"){const o=s();if(!o)return Promise.resolve(null);if(typeof o=="string"||Array.isArray(o))return Promise.resolve(o);if(o.then)return o}throw Error("Invalid protocols")}_getNextUrl(s){if(typeof s=="string")return Promise.resolve(s);if(typeof s=="function"){const o=s();if(typeof o=="string")return Promise.resolve(o);if(o.then)return o}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:s=jr.maxRetries,connectionTimeout:o=jr.connectionTimeout}=this._options;if(this._retryCount>=s){this._debug("max retries reached",this._retryCount,">=",s);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([a,u])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!Fm&&(console.error(`‼️ No WebSocket implementation available. You should define options.WebSocket. For example, if you're using node.js, run \`npm install ws\`, and then in your code: import PartySocket from 'partysocket'; import WS from 'ws'; const partysocket = new PartySocket({ host: "127.0.0.1:1999", room: "test-room", WebSocket: WS }); `),Fm=!0);const d=this._options.WebSocket||WebSocket;this._debug("connect",{url:a,protocols:u}),this._ws=u?new d(a,u):new d(a),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),o)}).catch(a=>{this._connectLock=!1,this._handleError(new uc.ErrorEvent(Error(a.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new uc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(s=1e3,o){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(s,o),this._handleClose(new uc.CloseEvent(s,o,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};/*! * Reconnecting WebSocket * by Pedro Ladaria * https://github.com/pladaria/reconnecting-websocket * License MIT */var hC=r=>r[1]!==null&&r[1]!==void 0;function pC(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();let r=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){let o=Math.random()*16;return r>0?(o=(r+o)%16|0,r=Math.floor(r/16)):(o=(t+o)%16|0,t=Math.floor(t/16)),(s==="x"?o:o&3|8).toString(16)})}function cv(r,t,s={}){const{host:o,path:a,protocol:u,room:d,party:h,query:p}=r;let m=o.replace(/^(http|https|ws|wss):\/\//,"");if(m.endsWith("/")&&(m=m.slice(0,-1)),a&&a.startsWith("/"))throw new Error("path must not start with a slash");const y=h??"main",v=a?`/${a}`:"",k=u||(m.startsWith("localhost:")||m.startsWith("127.0.0.1:")||m.startsWith("192.168.")||m.startsWith("10.")||m.startsWith("172.")&&m.split(".")[1]>="16"&&m.split(".")[1]<="31"||m.startsWith("[::ffff:7f00:1]:")?t:t+"s"),L=`${k}://${m}/${h?`parties/${h}`:"party"}/${d}${v}`,F=(x={})=>`${L}?${new URLSearchParams([...Object.entries(s),...Object.entries(x).filter(hC)])}`,b=typeof p=="function"?async()=>F(await p()):F(p);return{host:m,path:v,room:d,name:y,protocol:k,partyUrl:L,urlProvider:b}}var mC=class extends fC{constructor(t){const s=Um(t);super(s.urlProvider,s.protocols,s.socketOptions);Ie(this,"_pk");Ie(this,"_pkurl");Ie(this,"name");Ie(this,"room");Ie(this,"host");Ie(this,"path");this.partySocketOptions=t,this.setWSProperties(s)}updateProperties(t){const s=Um({...t,host:t.host??this.host,room:t.room??this.room,path:t.path??this.path});this._url=s.urlProvider,this._protocols=s.protocols,this._options=s.socketOptions,this.setWSProperties(s)}setWSProperties(t){const{_pk:s,_pkurl:o,name:a,room:u,host:d,path:h}=t;this._pk=s,this._pkurl=o,this.name=a,this.room=u,this.host=d,this.path=h}reconnect(t,s){if(!this.room||!this.host)throw new Error("The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.");super.reconnect(t,s)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(t,s){const o=cv(t,"http"),a=typeof o.urlProvider=="string"?o.urlProvider:await o.urlProvider();return(t.fetch??fetch)(a,s)}};function Um(r){const{id:t,host:s,path:o,party:a,room:u,protocol:d,query:h,protocols:p,...m}=r,y=t||pC(),v=cv(r,"ws",{_pk:y});return{_pk:y,_pkurl:v.partyUrl,name:v.name,room:v.room,host:v.host,path:v.path,protocols:p,socketOptions:m,urlProvider:v.urlProvider}}const gC=1e3,yC=3e3;class vC{constructor(t,s,o,a,u){var d;this.onClose=u,this.listeners=new Set,this.heartbeat=null,this.id=(d=a==null?void 0:a.id)!==null&&d!==void 0?d:crypto.randomUUID();const h=new mC({host:o.host,party:t,room:s,id:this.id,query:()=>{const y=o.getAuthToken();return{app_id:o.appId,handler:t,...y?{token:y}:{},...o.functionsVersion?{fv:o.functionsVersion}:{}}}});this.ws=h;let p=Date.now();const m=()=>{p=Date.now()};h.addEventListener("open",m),h.addEventListener("message",y=>{m();let v;try{v=JSON.parse(y.data)}catch{return}if((v&&typeof v=="object"?v.type:void 0)!=="__pong")for(const L of this.listeners)L(v)}),this.heartbeat=setInterval(()=>{if(Date.now()-p>yC){m(),h.reconnect();return}try{h.send(JSON.stringify({type:"__ping"}))}catch{}},gC)}subscribe(t){return this.listeners.add(t),{unsubscribe:()=>{this.listeners.delete(t)}}}send(t){this.ws.send(JSON.stringify(t))}close(){this.heartbeat&&(clearInterval(this.heartbeat),this.heartbeat=null),this.listeners.clear(),this.ws.close(),this.onClose()}}function wC(r,t,s,o){let a=null;return{connect(u){if(a)return a;const d=new vC(r,t,s,u,()=>{o.delete(d),a===d&&(a=null)});return a=d,o.add(d),d}}}function xC(r,t){return r&&!r.startsWith("/")?r:t??r}function EC(r){const t=new Set;return{module:new Proxy({},{get(o,a){if(!(typeof a!="string"||a==="then"))return u=>wC(a,u,r,t)}}),closeAll:()=>{for(const o of[...t])o.close()}}}function SC(r){var t,s,o;const{serverUrl:a="https://base44.app",appId:u,token:d,serviceToken:h,requiresAuth:p=!1,appBaseUrl:m,options:y,functionsVersion:v,headers:k}=r,L=typeof m=="string"?m:"",F={serverUrl:a,mountPath:"/ws-user-apps/socket.io/",transports:["websocket"],appId:u,token:d};let b=null;const x=()=>(b||(b=aC({config:F})),b),S={...k,"X-App-Id":String(u)},I=v?{...S,"Base44-Functions-Version":v}:S,P=Bo({baseURL:`${a}/api`,headers:S,token:d,onError:y==null?void 0:y.onError}),A=Bo({baseURL:`${a}/api`,headers:I,token:d,interceptResponses:!1,onError:y==null?void 0:y.onError}),V={...S,...d?{"on-behalf-of":`Bearer ${d}`}:{}},$=Bo({baseURL:`${a}/api`,headers:V,token:h,onError:y==null?void 0:y.onError}),G=Bo({baseURL:`${a}/api`,headers:I,token:h,interceptResponses:!1}),B=ak(P,A,u,{appBaseUrl:L});if(typeof window<"u"){const xe=d||Gr();xe&&B.setToken(xe)}const ie=EC({appId:u,host:xC(a,typeof window<"u"?(t=window.location)===null||t===void 0?void 0:t.origin:void 0),functionsVersion:v,getAuthToken:()=>d||Gr()}),ue={entities:Cm({axios:P,appId:u,getSocket:x}),integrations:Rm(P,u),connectors:ck(P,u),auth:B,functions:Tm(A,u,{getAuthHeaders:()=>{const xe={},J=d||Gr();return J&&(xe.Authorization=`Bearer ${J}`),xe},baseURL:(s=A.defaults)===null||s===void 0?void 0:s.baseURL}),agents:Pm({axios:P,getSocket:x,appId:u,serverUrl:a,token:d}),aiGateway:Nm({serverUrl:a,token:d,appId:u}),appLogs:Om(P,u),users:fk(P,u),analytics:Qb({axiosClient:P,serverUrl:a,appId:u,userAuthModule:B}),actors:ie.module,cleanup:()=>{ue.analytics.cleanup(),ie.closeAll(),b&&b.disconnect()}},Ee={entities:Cm({axios:$,appId:u,getSocket:x}),integrations:Rm($,u),sso:lk($,u),connectors:uk($,u),functions:Tm(G,u,{getAuthHeaders:()=>{const xe={};return h&&(xe.Authorization=`Bearer ${h}`),xe},baseURL:(o=G.defaults)===null||o===void 0?void 0:o.baseURL}),agents:Pm({axios:$,getSocket:x,appId:u,serverUrl:a,token:d}),aiGateway:Nm({serverUrl:a,token:h,appId:u}),appLogs:Om($,u),cleanup:()=>{b&&b.disconnect()}};return p&&typeof window<"u"&&setTimeout(async()=>{try{await ue.auth.isAuthenticated()||ue.auth.redirectToLogin(window.location.href)}catch(xe){console.error("Authentication check failed:",xe),ue.auth.redirectToLogin(window.location.href)}},0),{...ue,setToken(xe){ue.auth.setToken(xe),b&&b.updateConfig({token:xe}),F.token=xe},getConfig(){return{serverUrl:a,appId:u,requiresAuth:p}},get asServiceRole(){if(!h)throw new Error("Service token is required to use asServiceRole. Please provide a serviceToken when creating the client.");return Ee}}}const dv=typeof window>"u",_C=dv?{localStorage:new Map}:window,qo=_C.localStorage,bC=r=>r.replace(/([A-Z])/g,"_$1").toLowerCase(),Ps=(r,{defaultValue:t=void 0,removeFromUrl:s=!1}={})=>{if(dv)return t;const o=`base44_${bC(r)}`,a=new URLSearchParams(window.location.search),u=a.get(r);if(s){a.delete(r);const h=`${window.location.pathname}${a.toString()?`?${a.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,h)}if(u)return qo.setItem(o,u),u;if(t)return qo.setItem(o,t),t;const d=qo.getItem(o);return d||null},kC=()=>(Ps("clear_access_token")==="true"&&(qo.removeItem("base44_access_token"),qo.removeItem("token")),{appId:Ps("app_id",{defaultValue:"6a7dd54964b2951f4d462add"}),token:Ps("access_token",{removeFromUrl:!0}),fromUrl:Ps("from_url",{defaultValue:window.location.href}),functionsVersion:Ps("functions_version",{defaultValue:"prod"}),appBaseUrl:Ps("app_base_url",{defaultValue:void 0})}),Vo={...kC()},{appId:CC,token:RC,functionsVersion:TC,appBaseUrl:PC}=Vo,Ho=SC({appId:CC,token:RC,functionsVersion:TC,serverUrl:"",requiresAuth:!1,appBaseUrl:PC});function NC({}){var a;const t=qs().pathname.substring(1),{data:s,isFetched:o}=NE({queryKey:["user"],queryFn:async()=>{try{return{user:await Ho.auth.me(),isAuthenticated:!0}}catch{return{user:null,isAuthenticated:!1}}}});return w.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 bg-slate-50",children:w.jsx("div",{className:"max-w-md w-full",children:w.jsxs("div",{className:"text-center space-y-6",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsx("h1",{className:"text-7xl font-light text-slate-300",children:"404"}),w.jsx("div",{className:"h-0.5 w-16 bg-slate-200 mx-auto"})]}),w.jsxs("div",{className:"space-y-3",children:[w.jsx("h2",{className:"text-2xl font-medium text-slate-800",children:"Page Not Found"}),w.jsxs("p",{className:"text-slate-600 leading-relaxed",children:["The page ",w.jsxs("span",{className:"font-medium text-slate-700",children:['"',t,'"']})," could not be found in this application."]})]}),o&&s.isAuthenticated&&((a=s.user)==null?void 0:a.role)==="admin"&&w.jsx("div",{className:"mt-8 p-4 bg-slate-100 rounded-lg border border-slate-200",children:w.jsxs("div",{className:"flex items-start space-x-3",children:[w.jsx("div",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-orange-100 flex items-center justify-center mt-0.5",children:w.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-400"})}),w.jsxs("div",{className:"text-left space-y-1",children:[w.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Admin Note"}),w.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:"This could mean that the AI hasn't implemented this page yet. Ask it to implement it in the chat."})]})]})}),w.jsx("div",{className:"pt-6",children:w.jsxs("button",{onClick:()=>window.location.href="/",className:"inline-flex items-center px-4 py-2 text-sm font-medium text-slate-700 bg-white border border-slate-200 rounded-lg hover:bg-slate-50 hover:border-slate-300 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500",children:[w.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),"Go Home"]})})]})})})}const fv=_.createContext(),OC=({children:r})=>{const[t,s]=_.useState(null),[o,a]=_.useState(!1),[u,d]=_.useState(!0),[h,p]=_.useState(!0),[m,y]=_.useState(null),[v,k]=_.useState(!1),[L,F]=_.useState(null);_.useEffect(()=>{b()},[]);const b=async()=>{var P,A;try{p(!0),y(null);const V=Bo({baseURL:"/api/apps/public",headers:{"X-App-Id":Vo.appId},token:Vo.token,interceptResponses:!0});try{const $=await V.get(`/prod/public-settings/by-id/${Vo.appId}`);F($),Vo.token?await x():(d(!1),a(!1),k(!0)),p(!1)}catch($){if(console.error("App state check failed:",$),$.status===403&&((A=(P=$.data)==null?void 0:P.extra_data)!=null&&A.reason)){const G=$.data.extra_data.reason;y(G==="auth_required"?{type:"auth_required",message:"Authentication required"}:G==="user_not_registered"?{type:"user_not_registered",message:"User not registered for this app"}:{type:G,message:$.message})}else y({type:"unknown",message:$.message||"Failed to load app"});p(!1),d(!1)}}catch(V){console.error("Unexpected error:",V),y({type:"unknown",message:V.message||"An unexpected error occurred"}),p(!1),d(!1)}},x=async()=>{try{d(!0);const P=await Ho.auth.me();s(P),a(!0),d(!1),k(!0)}catch(P){console.error("User auth check failed:",P),d(!1),a(!1),k(!0),(P.status===401||P.status===403)&&y({type:"auth_required",message:"Authentication required"})}},S=(P=!0)=>{s(null),a(!1),P?Ho.auth.logout(window.location.href):Ho.auth.logout()},I=()=>{Ho.auth.redirectToLogin(window.location.href)};return w.jsx(fv.Provider,{value:{user:t,isAuthenticated:o,isLoadingAuth:u,isLoadingPublicSettings:h,authError:m,appPublicSettings:L,authChecked:v,logout:S,navigateToLogin:I,checkUserAuth:x,checkAppState:b},children:r})},AC=()=>{const r=_.useContext(fv);if(!r)throw new Error("useAuth must be used within an AuthProvider");return r},LC=()=>w.jsx("div",{className:"flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-white to-slate-50",children:w.jsx("div",{className:"max-w-md w-full p-8 bg-white rounded-lg shadow-lg border border-slate-100",children:w.jsxs("div",{className:"text-center",children:[w.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-orange-100",children:w.jsx("svg",{className:"w-8 h-8 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),w.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-4",children:"Access Restricted"}),w.jsx("p",{className:"text-slate-600 mb-8",children:"You are not registered to use this application. Please contact the app administrator to request access."}),w.jsxs("div",{className:"p-4 bg-slate-50 rounded-md text-sm text-slate-600",children:[w.jsx("p",{children:"If you believe this is an error, you can:"}),w.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[w.jsx("li",{children:"Verify you are logged in with the correct account"}),w.jsx("li",{children:"Contact the app administrator for access"}),w.jsx("li",{children:"Try logging out and back in again"})]})]})]})})}),IC=r=>{const t=r.slice(1);try{return decodeURIComponent(t)}catch{return t}};function jC(){const{pathname:r,hash:t}=qs(),s=aS();return _.useEffect(()=>{if(s!=="POP"){if(t){const o=IC(t),a=window.setTimeout(()=>{var u;(u=document.getElementById(o))==null||u.scrollIntoView({behavior:"smooth"})},50);return()=>window.clearTimeout(a)}window.scrollTo({top:0,left:0,behavior:"instant"})}},[r,t,s]),null}const zm=[{label:"About",to:"/"},{label:"Portfolio",to:"/"},{label:"Sustainability",to:"/"},{label:"News & Media",to:"/",active:!0},{label:"Investor Relations",to:"/"},{label:"Contact",to:"/"}];function DC(){const[r,t]=_.useState(!1),[s,o]=_.useState(!1);return _.useEffect(()=>{const a=()=>t(window.scrollY>10);return window.addEventListener("scroll",a,{passive:!0}),()=>window.removeEventListener("scroll",a)},[]),w.jsxs("header",{className:"sticky top-0 z-50 bg-white border-b border-hairline transition-shadow",style:{boxShadow:r?"0 1px 0 rgba(0,0,0,0.04)":"none"},children:[w.jsx("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10",children:w.jsxs("div",{className:"flex items-center justify-between h-[68px] md:h-[84px]",children:[w.jsxs(Mn,{to:"/",className:"flex items-center gap-3","aria-label":"Alrazah Holding home",children:[w.jsx("span",{className:"inline-flex items-center justify-center w-9 h-9 md:w-10 md:h-10 bg-alrazah text-white font-heading text-xl font-bold leading-none",children:"A"}),w.jsxs("span",{className:"flex flex-col leading-none",children:[w.jsx("span",{className:"font-heading text-[19px] md:text-[22px] font-bold text-ink tracking-tight",children:"ALRAZAH"}),w.jsx("span",{className:"text-[9px] md:text-[10px] font-semibold tracking-[0.32em] text-slatey uppercase",children:"Q.P.S.C."})]})]}),w.jsx("nav",{className:"hidden lg:flex items-center gap-8","aria-label":"Primary",children:zm.map(a=>w.jsx(Mn,{to:a.to,className:`text-[13px] font-medium tracking-wide transition-colors ${a.active?"text-alrazah":"text-ink hover:text-alrazah"}`,children:a.label},a.label))}),w.jsxs("div",{className:"hidden lg:flex items-center gap-2",children:[w.jsx("button",{"aria-label":"Search",className:"w-9 h-9 inline-flex items-center justify-center text-ink hover:text-alrazah transition-colors",children:w.jsx(Xx,{className:"w-[18px] h-[18px]"})}),w.jsxs("button",{className:"inline-flex items-center gap-1 text-[12px] font-semibold tracking-wide text-ink hover:text-alrazah transition-colors",children:["EN ",w.jsx(Ix,{className:"w-3 h-3"})]})]}),w.jsx("button",{className:"lg:hidden w-9 h-9 inline-flex items-center justify-center text-ink","aria-label":"Toggle menu",onClick:()=>o(a=>!a),children:s?w.jsx(Ig,{className:"w-6 h-6"}):w.jsx(qx,{className:"w-6 h-6"})})]})}),s&&w.jsx("div",{className:"lg:hidden border-t border-hairline bg-white",children:w.jsx("nav",{className:"px-5 py-4 flex flex-col gap-1","aria-label":"Mobile",children:zm.map(a=>w.jsx(Mn,{to:a.to,onClick:()=>o(!1),className:`py-2 text-[15px] font-medium ${a.active?"text-alrazah":"text-ink"}`,children:a.label},a.label))})})]})}const MC=[{title:"Company",links:["About Alrazah","Leadership","Governance","Sustainability"]},{title:"Portfolio",links:["Investment Portfolio","Sectors","Geographies","Case Studies"]},{title:"Investors",links:["Investor Relations","Financial Reports","Share Information","AGM"]},{title:"Media",links:["News & Media","Press Releases","Media Library","Media Contacts"]}];function FC(){return w.jsx("footer",{className:"bg-ink text-white",children:w.jsxs("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10 py-14 md:py-20",children:[w.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-8",children:[w.jsxs("div",{className:"lg:col-span-4",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"inline-flex items-center justify-center w-10 h-10 bg-alrazah text-white font-heading text-xl font-bold leading-none",children:"A"}),w.jsxs("div",{className:"flex flex-col leading-none",children:[w.jsx("span",{className:"font-heading text-[22px] font-bold tracking-tight",children:"ALRAZAH"}),w.jsx("span",{className:"text-[10px] font-semibold tracking-[0.32em] text-white/60 uppercase",children:"Q.P.S.C."})]})]}),w.jsx("p",{className:"mt-6 text-[13px] leading-[1.7] text-white/60 max-w-[320px]",children:"A premier publicly listed investment entity on the Qatar Stock Exchange, partnering with globally recognized enterprises to build enduring value."}),w.jsx("p",{className:"mt-6 text-[12px] text-white/50",children:"Doha, State of Qatar"})]}),w.jsx("div",{className:"lg:col-span-8 grid grid-cols-2 sm:grid-cols-4 gap-8",children:MC.map(r=>w.jsxs("div",{children:[w.jsx("p",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-white/50 mb-4",children:r.title}),w.jsx("ul",{className:"space-y-2.5",children:r.links.map(t=>w.jsx("li",{children:w.jsx(Mn,{to:"/",className:"text-[13px] text-white/75 hover:text-white transition-colors",children:t})},t))})]},r.title))})]}),w.jsxs("div",{className:"mt-14 pt-8 border-t border-white/15 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[w.jsxs("p",{className:"text-[12px] text-white/50",children:["© ",new Date().getFullYear()," Alrazah Holding Q.P.S.C. All rights reserved."]}),w.jsx("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:["Privacy Policy","Terms of Use","Cookie Policy","Disclaimer"].map(r=>w.jsx(Mn,{to:"/",className:"text-[12px] text-white/50 hover:text-white transition-colors",children:r},r))})]})]})})}const UC=[{label:"Home",to:"/"},{label:"News & Media",to:"/"},{label:"Press Releases",to:"/"}];function zC({current:r}){return w.jsx("nav",{"aria-label":"Breadcrumb",className:"alrazah-breadcrumb border-b border-hairline bg-white",children:w.jsx("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10 py-[18px] md:py-[22px]",children:w.jsxs("ol",{className:"flex flex-wrap items-center gap-1.5 text-[12px] md:text-[13px] font-medium text-slatey",children:[UC.map((t,s)=>w.jsxs(Ln.Fragment,{children:[w.jsx("li",{children:w.jsx(Mn,{to:t.to,className:"hover:text-alrazah transition-colors",children:t.label})}),w.jsx("li",{"aria-hidden":"true",className:"text-hairline",children:w.jsx(Dx,{className:"w-3 h-3"})})]},t.label)),w.jsx("li",{className:"text-alrazah line-clamp-1","aria-current":"page",title:r,children:r})]})})})}function BC({category:r,title:t,date:s,location:o,org:a}){return w.jsx("section",{className:"alrazah-hero bg-alrazah text-white",children:w.jsx("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10 py-10 md:py-14",children:w.jsxs("div",{className:"max-w-[1050px]",children:[w.jsx("p",{className:"text-[12px] font-bold tracking-[0.14em] uppercase text-white/90 mb-5 md:mb-6",children:r}),w.jsx("h1",{className:"font-heading font-bold text-white text-balance leading-[1.08] text-[30px] sm:text-[34px] md:text-[42px] lg:text-[48px]",children:t}),w.jsx("p",{className:"mt-5 md:mt-6 text-[14px] md:text-[15px] text-white/85 font-medium",children:s}),w.jsxs("div",{className:"mt-6 md:mt-8 pt-5 md:pt-6 border-t border-white/20 flex flex-wrap items-center gap-x-6 gap-y-2",children:[w.jsx("span",{className:"text-[11px] md:text-[12px] font-semibold tracking-[0.14em] uppercase text-white/80",children:o}),w.jsx("span",{className:"hidden sm:inline-block w-px h-3 bg-white/30"}),w.jsx("span",{className:"text-[11px] md:text-[12px] font-semibold tracking-[0.14em] uppercase text-white/80",children:a})]})]})})})}const Bm=[{num:"01",stat:"€432 MILLION",label:"Cornerstone Investment",desc:"Alrazah Holding will commit €432 million as part of RWE's approximately €4 billion equity capital raise."},{num:"02",stat:"9.27% → 9.87%",label:"Increased RWE Stake",desc:"The transaction increases Alrazah Holding's equity stake in RWE."},{num:"03",stat:"55% RWE STAKE",label:"Critical Infrastructure",desc:"The capital raise supports RWE's increased indirect ownership of Amprion to 55%."},{num:"04",stat:"11,000 KM NETWORK",label:"European Energy Transition",desc:"Amprion operates approximately 11,000 kilometres of extra-high-voltage transmission infrastructure serving approximately 29 million people."}];function $C({supportLine:r}){return w.jsx("section",{className:"bg-alrazah-tint border-b border-hairline",children:w.jsxs("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10 py-10 md:py-14",children:[w.jsx("p",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-alrazah mb-3",children:"Key Takeaways"}),w.jsx("p",{className:"font-heading text-[18px] md:text-[22px] leading-[1.45] text-ink max-w-[920px] mb-8 md:mb-10",children:r}),w.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 border border-alrazah/20 bg-white",children:Bm.map((t,s)=>w.jsxs("div",{className:`p-6 md:p-7 ${sw.jsxs("div",{className:`px-4 md:px-8 py-2 ${t<2?"border-b lg:border-b-0 border-white/15":""} ${t===0?"pl-0 md:pl-8":""} ${t===2?"pl-0 md:pl-8":""}`,children:[w.jsx("p",{className:"font-heading text-[26px] md:text-[34px] font-bold leading-none tracking-tight",children:r.value}),w.jsx("p",{className:"mt-3 text-[12px] md:text-[13px] leading-[1.5] text-white/80",children:r.label})]},t))})})})})}const WC=[{label:"LinkedIn",Icon:$x,href:"https://www.linkedin.com"},{label:"X",Icon:Jx,href:"https://twitter.com"},{label:"Facebook",Icon:Fx,href:"https://www.facebook.com"},{label:"Email",Icon:Hx,href:"mailto:?subject=Alrazah Holding Press Release"}];function hv({variant:r="sidebar"}){const[t,s]=_.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(window.location.href),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},a=r==="sidebar"?"w-9 h-9":"w-10 h-10",u=r==="sidebar"?"w-[16px] h-[16px]":"w-[18px] h-[18px]";return w.jsx("div",{className:r==="row"?"flex flex-wrap items-center gap-2":"",children:w.jsxs("div",{className:r==="row"?"flex items-center gap-2":"grid grid-cols-5 gap-2",children:[WC.map(({label:d,Icon:h,href:p})=>w.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer","aria-label":`Share on ${d}`,className:`${a} inline-flex items-center justify-center border border-hairline text-ink hover:bg-alrazah hover:text-white hover:border-alrazah transition-colors`,children:w.jsx(h,{className:u})},d)),w.jsx("button",{onClick:o,"aria-label":"Copy link",className:`${a} inline-flex items-center justify-center border border-hairline text-ink hover:bg-alrazah hover:text-white hover:border-alrazah transition-colors`,children:t?w.jsx(Ax,{className:u}):w.jsx(zx,{className:u})})]})})}const cc=[{id:"overview",label:"Overview",num:"01"},{id:"grid",label:"Germany's Energy Grid",num:"02"},{id:"alignment",label:"Strategic Alignment",num:"03"},{id:"about-rwe",label:"About RWE",num:"04"}];function qC(){const[r,t]=_.useState("overview");return _.useEffect(()=>{const s=()=>{let o=cc[0].id;for(const a of cc){const u=document.getElementById(a.id);u&&u.getBoundingClientRect().top<=140&&(o=a.id)}t(o)};return window.addEventListener("scroll",s,{passive:!0}),s(),()=>window.removeEventListener("scroll",s)},[]),w.jsx("aside",{className:"alrazah-sidebar hidden lg:block",children:w.jsxs("div",{className:"sticky top-[104px]",children:[w.jsxs("nav",{"aria-label":"On this page",className:"mb-10",children:[w.jsx("p",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-alrazah mb-4",children:"On This Page"}),w.jsx("ul",{className:"space-y-1",children:cc.map(s=>w.jsx("li",{children:w.jsxs("a",{href:`#${s.id}`,className:`group flex items-start gap-3 py-2 pl-3 text-[13px] leading-snug transition-colors border-l-2 ${r===s.id?"border-alrazah text-alrazah font-semibold":"border-transparent text-slatey hover:text-ink"}`,children:[w.jsx("span",{className:"text-[11px] font-bold tracking-wide text-slatey/60 group-hover:text-ink",children:s.num}),w.jsx("span",{children:s.label})]})},s.id))})]}),w.jsxs("div",{className:"pt-6 border-t border-hairline",children:[w.jsx("p",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-alrazah mb-4",children:"Share"}),w.jsx(hv,{variant:"sidebar"})]})]})})}function QC(){return w.jsx("div",{className:"alrazah-share-bar border-t border-hairline mt-14 md:mt-20 pt-8",children:w.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-6",children:[w.jsxs("div",{className:"flex items-center gap-4",children:[w.jsx("span",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-alrazah",children:"Share"}),w.jsx(hv,{variant:"row"})]}),w.jsxs("button",{onClick:()=>window.print(),className:"inline-flex items-center gap-2 text-[12px] font-semibold uppercase tracking-[0.08em] text-ink hover:text-alrazah transition-colors",children:[w.jsx(Kx,{className:"w-4 h-4"}),"Print"]})]})})}const KC=[{date:"12 May 2026",category:"Press Release",title:"Alrazah Holding Reports Strong First-Quarter Financial Performance and Portfolio Growth",excerpt:"The company delivered sustained growth across its core investment segments, reinforcing its disciplined capital allocation framework."},{date:"28 March 2026",category:"Press Release",title:"Alrazah Holding Completes Strategic Investment in Global Logistics Infrastructure Platform",excerpt:"The transaction extends Alrazah's international infrastructure exposure and long-term value-creation mandate."},{date:"04 February 2026",category:"Press Release",title:"Alrazah Holding Announces Board Approval of Expanded International Investment Mandate",excerpt:"The mandate broadens Alrazah's capacity to participate in globally significant capital-markets transactions."}];function GC(){return w.jsx("section",{className:"alrazah-related bg-institutional border-t border-hairline",children:w.jsxs("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10 py-12 md:py-16",children:[w.jsx("p",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-alrazah mb-8",children:"Related Press Releases"}),w.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-px bg-hairline border border-hairline",children:KC.map((r,t)=>w.jsxs(Mn,{to:"/",className:"group flex flex-col bg-white p-6 md:p-7 hover:bg-alrazah-tint transition-colors",children:[w.jsxs("div",{className:"flex items-center gap-3 text-[11px] font-semibold uppercase tracking-[0.08em] text-slatey",children:[w.jsx("span",{children:r.date}),w.jsx("span",{className:"w-1 h-1 rounded-full bg-slatey/40"}),w.jsx("span",{className:"text-alrazah",children:r.category})]}),w.jsx("h3",{className:"mt-4 font-heading text-[18px] md:text-[20px] font-bold text-ink leading-[1.25] group-hover:text-alrazah transition-colors",children:r.title}),w.jsx("p",{className:"mt-3 text-[13px] leading-[1.6] text-slatey flex-1",children:r.excerpt}),w.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-[12px] font-semibold uppercase tracking-[0.08em] text-alrazah",children:["Read release",w.jsx(Lg,{className:"w-3.5 h-3.5 transition-transform group-hover:translate-x-1"})]})]},t))})]})})}function XC(){return w.jsx("section",{className:"alrazah-cta bg-alrazah text-white",children:w.jsx("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10 py-14 md:py-16",children:w.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-end lg:justify-between gap-8",children:[w.jsxs("div",{className:"max-w-[640px]",children:[w.jsx("p",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-white/70 mb-4",children:"Stay Informed"}),w.jsx("h2",{className:"font-heading text-[28px] md:text-[36px] font-bold leading-[1.1] text-white",children:"Follow Alrazah's latest corporate announcements, developments and institutional news."})]}),w.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 lg:shrink-0",children:[w.jsxs(Mn,{to:"/",className:"inline-flex items-center justify-center gap-2 bg-white text-alrazah px-6 py-3.5 text-[13px] font-bold uppercase tracking-[0.08em] hover:bg-alrazah-tint transition-colors",children:["View All Press Releases",w.jsx(Lg,{className:"w-4 h-4"})]}),w.jsx(Mn,{to:"/",className:"inline-flex items-center justify-center gap-2 border border-white/40 text-white px-6 py-3.5 text-[13px] font-bold uppercase tracking-[0.08em] hover:bg-white/10 transition-colors",children:"Contact Alrazah"})]})]})})})}const $m="Alrazah Holding Secures Cornerstone Investor Role in RWE's €4 Billion Equity Capital Raise to Expand Critical European Energy Infrastructure",YC="DOHA, State of Qatar – June 23, 2026 – Alrazah Holding, a premier publicly listed investment entity on the Qatar Stock Exchange, has officially announced its participation as a cornerstone investor in the approximately €4 billion equity capital raise executed by RWE AG, Germany's largest power generation company and a globally recognized leader in renewable and flexible energy solutions. Through this strategic investment, Alrazah Holding will commit €432 million, thereby increasing its equity stake in RWE from 9.27% to 9.87%. This transaction underscores Alrazah Holding's steadfast commitment to backing world-class energy enterprises that are driving the global transition toward sustainable and decarbonized power systems.",dc=({children:r})=>w.jsx("h2",{className:"font-heading text-[24px] md:text-[30px] font-bold text-ink leading-[1.2] mt-12 md:mt-16 mb-6 md:mb-8",children:r});function Vm(){return w.jsxs("div",{className:"min-h-screen bg-white",children:[w.jsx(DC,{}),w.jsx(zC,{current:$m}),w.jsx(BC,{category:"Press Release",title:$m,date:"23 June 2026",location:"Doha · State of Qatar",org:"Alrazah Holding"}),w.jsx($C,{supportLine:"Alrazah Holding participates as a cornerstone investor in RWE's approximately €4 billion equity capital raise, strengthening its position alongside a globally significant energy and infrastructure company."}),w.jsx("section",{className:"bg-white",children:w.jsx("div",{className:"mx-auto max-w-[1280px] px-5 md:px-10 py-12 md:py-16",children:w.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_280px] lg:gap-16",children:[w.jsxs("article",{className:"max-w-article article-prose",children:[w.jsx("p",{id:"overview",className:"text-[19px] md:text-[19px] leading-[1.65] text-ink font-medium scroll-mt-32",children:YC}),w.jsx(dc,{children:w.jsx("span",{id:"grid",className:"scroll-mt-32 block",children:"Strengthening Germany's Energy Grid and Electrification Infrastructure"})}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"The proceeds of RWE's approximately €4 billion equity capital raise support the company's acquisition of an additional 35% indirect ownership of Amprion GmbH, bringing RWE's total stake in the transmission system operator to 55%. Amprion operates approximately 11,000 kilometres of extra-high-voltage transmission infrastructure across Germany, serving approximately 29 million people and forming a central component of the country's electricity grid."}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"The transaction is positioned within the broader context of European electrification, renewable power integration and the progressive decarbonisation of the energy system. Transmission infrastructure of this scale is widely regarded as a precondition for the reliable integration of renewable generation and for the structural modernisation of the European power network."}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"Through its increased exposure to Amprion via RWE, Alrazah Holding's participation is connected to a category of infrastructure defined by regulated, long-duration cash flows and strategic national significance."}),w.jsx(HC,{}),w.jsx(dc,{children:w.jsx("span",{id:"alignment",className:"scroll-mt-32 block",children:"Executive Commentary on Strategic Alignment"})}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"The cornerstone investment reflects Alrazah Holding's stated strategy of partnering with globally recognized energy and infrastructure companies positioned to support long-term value creation and the evolving requirements of the global energy system. Alrazah Holding characterises the transaction as a disciplined deployment of capital alongside a leading participant in the international energy transition."}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"The increase in Alrazah Holding's RWE equity stake from 9.27% to 9.87% reinforces a position established through prior investment and signals continued conviction in the company's strategic direction and its role within critical European energy infrastructure."}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"Alrazah Holding frames the commitment within its broader mandate to participate in globally significant capital-markets transactions that align durable cash-flow generation with structural shifts in the international economy."}),w.jsxs("div",{className:"alrazah-rule bg-alrazah-tint px-6 md:px-8 py-7 md:py-9 my-12 md:my-16",children:[w.jsx("p",{className:"text-[11px] font-bold tracking-[0.14em] uppercase text-alrazah mb-3",children:"Investing in Critical Energy Infrastructure"}),w.jsx("p",{className:"text-[16px] leading-[1.7] text-ink",children:"Alrazah Holding's participation in RWE's equity capital raise reflects its stated strategy of partnering with globally recognized energy and infrastructure companies positioned to support long-term value creation and the evolving requirements of the global energy system."})]}),w.jsx(dc,{children:w.jsx("span",{id:"about-rwe",className:"scroll-mt-32 block",children:"About RWE AG"})}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"RWE AG is Germany's largest power generation company and a globally recognized leader in renewable and flexible energy solutions. The company is an active participant in the generation, trading and supply of electricity, with operations spanning renewable and conventional generation and an established role in the European energy transition."}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"Following the equity capital raise and the associated increase in its indirect ownership of Amprion, RWE holds a 55% stake in the transmission system operator. Amprion's approximately 11,000-kilometre extra-high-voltage network serves approximately 29 million people and constitutes a critical element of Germany's electricity transmission infrastructure."}),w.jsx("p",{className:"text-[17px] leading-[1.75] text-ink",children:"Alrazah Holding's cornerstone participation in RWE's approximately €4 billion equity capital raise, and the resulting increase in its equity stake from 9.27% to 9.87%, reaffirm the company's positioning as a Qatari investment institution capable of participating in internationally significant transactions, and its commitment to partnering with globally dominant infrastructure and energy enterprises offering substantial long-term value-creation opportunities."}),w.jsx(QC,{})]}),w.jsx(qC,{})]})})}),w.jsx(GC,{}),w.jsx(XC,{}),w.jsx(FC,{})]})}const JC=()=>{const{isLoadingAuth:r,isLoadingPublicSettings:t,authError:s,navigateToLogin:o}=AC();if(t||r)return w.jsx("div",{className:"fixed inset-0 flex items-center justify-center",children:w.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-slate-800 rounded-full animate-spin"})});if(s){if(s.type==="user_not_registered")return w.jsx(LC,{});if(s.type==="auth_required")return o(),null}return w.jsxs(kS,{children:[w.jsx(La,{path:"/",element:w.jsx(Vm,{})}),w.jsx(La,{path:"/news-media/press-release/alrazah-holding-secures-cornerstone-investor-role-in-rwes-4-billion-equity-capital-raise-to-expand-critical-european-energy-infrastructure/",element:w.jsx(Vm,{})}),w.jsx(La,{path:"*",element:w.jsx(NC,{})})]})};function ZC(){return w.jsx(OC,{children:w.jsxs(vE,{client:OE,children:[w.jsxs(AS,{children:[w.jsx(jC,{}),w.jsx(JC,{})]}),w.jsx(q1,{})]})})}E0.createRoot(document.getElementById("root")).render(w.jsx(ZC,{}));